mga_ka_php Posted January 16, 2009 Share Posted January 16, 2009 can rsync copy only new and modified files only? i want to backup my website and copy only the updated and new files because we have an account which is almost 3GB and if i do full backup that regularly it will eat so much storage space and long load for both servers. how do i accomplish that? can you specify the parameters to be used. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/141023-rsync-parameters-to-copy-newmodified-files/ Share on other sites More sharing options...
MachineHead933 Posted January 20, 2009 Share Posted January 20, 2009 The best place to start is always a man page: http://www.manpagez.com/man/1/rsync/ What you are describing is essentially the default behavior of rsync, but your best bet would be to use -a, so your rsync would look like this: rsync -e ssh -avz --delete-after /path/to/stuff user@slave:/path/to -e Specifies the files will be sent through SSH -avz This is a combination of 3 options. The "-a" means archive. This will preserve symlinks, permissions, timestamps, group/owners, and will be recursive. The "v" makes the job verbose. This won't be necessary, but you can see what's happening with the rsync so you know if you've done something wrong. The "z" compresses data to speed up the transfer. --delete-after Will tell rsync to compare the destination against the source and delete any extraneous files after the rsync has completed. This is a dangerous option, so use with caution. I would recommend doing a dry-run before actually running any commands on your production environment, to do this, just throw an "n" into the command: rsync -e ssh -avzn --delete-after /path/to/stuff user@slave:/path/to This will spit out what rsync _would_ do, but doesn't actually copy anything. -- Vincent Gerbino HostMySite Technical Support, Manager vinny@hostmysite.com http://www.HostMySite.com?utm_source=bb Quote Link to comment https://forums.phpfreaks.com/topic/141023-rsync-parameters-to-copy-newmodified-files/#findComment-741299 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.