如何同步单个文件? [英] How to RSYNC a single file?

查看:71
本文介绍了如何同步单个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我只像这样同步Directories:

Currently i only RSync-ing the Directories as like:

* * * * * rsync -avz /var/www/public_html/images root@<remote-ip>:/var/www/public_html

那我怎么rsync一个像/var/www/public_html/.htaccess这样的文件呢?

So how do i rsync one single file like, /var/www/public_html/.htaccess ?

推荐答案

您执行的操作与创建目录的方法相同,但是您将文件名的完整路径指定为源.在您的示例中:

You do it the same way as you would a directory, but you specify the full path to the filename as the source. In your example:

rsync -avz /var/www/public_html/.htaccess root@<remote-ip>:/var/www/public_html/

这篇关于如何同步单个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆