How to RSYNC a single file?

后端 未结 4 1453
庸人自扰
庸人自扰 2021-01-31 06:33

Currently i only RSync-ing the Directories as like:

* * * * * rsync -avz /var/www/public_html/images root@:/var/www/public_html
         


        
4条回答
  •  暖寄归人
    2021-01-31 07:11

    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   --progress  /var/www/public_html/.htaccess root@:/var/www/public_html/
    

    As mentioned in the comments: since -a includes recurse, one little typo can make it kick off a full directory tree transfer, so a more fool-proof approach might to just use -vz, or replace it with -lptgoD.

提交回复
热议问题