Rsync tips
Feb 22, 2010 Tech
So ive recently been stufying rsync mauals and guides etc because im using it to backup up a webserver, so i thought i’d post a few tips that have helped me be less confused about the whole thing, when it comes to error messages etc :p
The destination folder on the remote server must be owned by remote user account that is being used to login via rsync, chmod permissions must also be at least write, 775 (for folders) & 644 (for files) is probly the best idea.
It doesnt matter what user is running rsync on the local system (rsync doesnt have to run as root on the local system, it only has to have read permissions to the files it wants to send via rsync), usernames do not have to be the same.
The only thing that matters is that the remote user account that is being used to login via rsync has read/write permissions to the appropriate directories.
its not required but if your doing a full system backup of / it might be a good idea to run rsync as root as it might not have read access to all the files if it doesnt run as root. (yes i know this probably sounds like a bad idea, but its just a thought :p i havent tested doing a full system backup yet).
When the files have been copied the owner and group will be changed to that of the remote user account that has been used to login via rsync, time stamps will remain as they were on the system they were sent from.
Source folders may be be owned by root or any user and they will still copy as long as read access is available to rsync.
AFAICT Best practice is (if possible):
chmod folders to 0755
chmod files to 0644
this also applies to destination directories, this means that rsync will actually copy the files instead of giving permission errors.
Syntax tip: When copying via rsync the trailing slash on the source directory indicates that it will only copy the contents of the folder. without the trailing slash rsync will also copy the directory name as well as the contents.
I also found these links to be handy:
http://amountaintop.com/rsync-non-standard-ssh-port
http://www.linux.com/archive/feature/113847
ok, thats all I have
have fun :p
If you liked that post, then try these...
Carry on using MSN 7.5 after a forced upgrade on September 16th, 2007
Testing a new plugin on September 29th, 2006
How to: Hack an ATM on October 6th, 2006
my sexy new multifunctional bootable autorunning switchblade, drive. on December 18th, 2007
Tools on June 13th, 2010




Leave a Reply