差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
rsync [2016/10/22 23:15] jz |
rsync [2024/03/17 00:58] (目前版本) jz |
||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== 複製資料 ====== | ||
+ | <code> | ||
+ | rsync -avhW --no-compress --info=progress2 src/ dst/ | ||
+ | </code> | ||
+ | |||
+ | |||
+ | |||
+ | |||
rsyncd 設定檔 (server) | rsyncd 設定檔 (server) | ||
行 57: | 行 65: | ||
<code> | <code> | ||
- | rsync -a --delete -e "ssh -i /home/user/.ssh/id_rsa" /home/CSNA2016/backup [email protected]:/home/user | + | rsync -a --progress --delete -e "ssh -i /home/user/.ssh/id_rsa" /home/CSNA2016/backup [email protected]:/home/user |
+ | </code> | ||
+ | |||
+ | ====== 標題 ====== | ||
+ | <code> | ||
+ | rsync -a --exclude 'file.txt' src_directory/ dst_directory/ | ||
+ | rsync -a --exclude 'dir1' src_directory/ dst_directory/ | ||
+ | rsync -a --exclude 'dir1/*' src_directory/ dst_directory/ | ||
+ | rsync -a --exclude 'file1.txt' --exclude 'dir1/*' --exclude 'dir2' src_directory/ dst_directory/ | ||
+ | rsync -a --exclude={'file1.txt','dir1/*','dir2'} src_directory/ dst_directory/ | ||
+ | rsync -a --exclude-from='exclude-file.txt' src_directory/ dst_directory/ | ||
+ | rsync -a --exclude '*.jpg*' src_directory/ dst_directory/ | ||
+ | rsync -a -m --include='*.jpg' --include='*/' --exclude='*' src_directory/ dst_directory/ | ||
+ | find src_directory/ -name "*.jpg" -printf %P\\0\\n | rsync -a --files-from=- src_directory/ dst_directory/ | ||
</code> | </code> | ||
行 63: | 行 84: | ||
* http://newsletter.ascc.sinica.edu.tw/news/read_news.php?nid=1742 | * http://newsletter.ascc.sinica.edu.tw/news/read_news.php?nid=1742 | ||
* http://blog.xuite.net/pippeng/blog/23403776 | * http://blog.xuite.net/pippeng/blog/23403776 | ||
+ | * https://www.myfreax.com/how-to-exclude-files-and-directories-with-rsync/ |