rsync -av --include='*/' --exclude='*' /path/to/src /path/to/dest/
rsync -av --include='*/' --exclude='*' /path/to/apache/logs/ root@www433.nixcraft.net.in:/path/to/apache/logs/
# cd /var/log/apache/
# rsync -av -f"+ */" -f"- *" . root@server2.nixcraft.com:/var/log/apache/
Sample outputs:
building file list ... done
./
cricketnow.in/
cyberciti.biz/
hexindia.net/
io9.in/
nixcraft.com/
theos.in/
sent 388 bytes received 98 bytes 972.00 bytes/sec
total size is 0 speedup is 0.00
You can also make local copies as follows:
# cd /var/log/apache/
# rsync -av -f"+ */" -f"- *" . /jailfs/apache/httpd_root/var/log/apache/
该博客介绍了如何使用rsync命令在不同服务器之间以及本地进行文件和目录的同步与备份。示例包括了排除特定文件和包含特定目录的参数设置,以及在/var/log/apache/目录下的操作。同时,提到了rsync的-a和-v选项用于保持文件属性和详细输出。
1万+

被折叠的 条评论
为什么被折叠?



