rsync --exclude 参数
2016-05-30 13:07
176 查看
/usr/bin/rsync -vr --exclude=".svn" --exclude="temp" --delete /alidata/www/pro/ecshop/ /alidata/www/crontal/ecshop
同步 除.svn 和temp 之外的文件
rsync 命令选项 源目录 目标目录 假如源目录写为 /var/www/就会把该目录下所有文件同步到目标目录,如果写为/var/www/*,那么当前目录下的隐藏文件(文件夹名或文件名是以”.”号开头)则不会被同步,不过子目录中的隐藏文件还是会被同步。 假设需要排除某个文件(或文件夹),可以用–exclude来指定,例如需要排除源目录下的dir1文件夹,可以写为: /usr/bin/rsync -vzrtopg –exclude=dir1 /var/www/src/ /var/www/dest 可以同时排除多条,例如: /usr/bin/rsync -vzrtopg –exclude=dir1 –exclude=dir2 /var/www/src/ /var/www/dest 除了上述方法,还可以通过–exclude-from来指定,例如: /usr/bin/rsync -vzrtopg –exclude-from=exclude.list /var/www/src/ /var/www/dest exclude.list文件中指定需要排除的列表,例如: dir1 [0-9]* dir2/.[a-z0-9]* .svn
------------------------------->实例
/usr/bin/rsync -vr --exclude=".svn" --exclude="temp/*" --exclude="data/config.php" --exclude="mobile/data/*" --exclude="mobile/include/base/constant.php" --delete /alidata/www/pro/ecshop/ /alidata/www/crontal/ecshop
可见都是相对路径
root@(none):~/svnclient/ecshop# la -a . api cert diy.php feed.php includes pick_out.php snatch.php wap .. api.php certi.php dl_receiver.php flash_sale.php index.php pm.php .svn wholesale.php activity.php article_cat.php chinabank_receive.php doc flow.php js quotation.php tag_cloud.php widget admin article.php comment.php ecmoban_qq gallery.php languages receive.php temai.php xxzz affiche.php auction.php compare.php ecs_template.frm goods.php message.php region.php temp affiliate.php brand.php cycle_image.php ecs_template.MYD goods_script.php mobile respond.php themes alipay.html captcha.php data ecs_template.MYI group_buy.php myship.php robots.txt topic.php allcate.php catalog.php delete_cart_goods.php exchange.php htaccess.txt package.php search.php user.php animated_favicon.gif category.php denglu.php favicon.ico images phpinfo.php sitemaps.php vote.php root@(none):~/svnclient/ecshop# pwd /root/svnclient/ecshop
root@(none):~/svnclient/ecshop# ecshop 下的 data/config.php temp/* mobile/data/* mobile/include/base/constant.php 不会被同步
相关文章推荐
- 安卓日记——手把手教你做知乎日报
- ValidateRequest="false"
- 用java数组实现栈
- 为什么寄存器比内存快?
- powerdesigner-从excel导入table模型
- openstack setup demo Enviroment
- hadoop文件合并
- 第十三周项目2-动物这样叫(3)
- MySql事务隔离级别
- gmail邮箱怎么批量删除邮件
- ACM 数据结构-并查集 HDU 1213 How Many Tables
- UVA 10739 [classical dp]
- me软件记录
- 自定义View实战-仿京东首页轮播文字(又名垂直跑马灯)
- 数组和广义表的基本运算实现
- Java EE使用Servlet获取web.xml中的参数
- 事务
- CentOS7下Firewall防火墙配置用法详解
- Android里Service的bindService()和startService()混合使用深入分析
- 解决win7 安装完jdk7后,再安装jdk8出现的问题 has value '1.8', but '1.7' is required.