I am trying to use rsync to copy a backup folder on a local machine to another machine daily (in case of data loss or accidental deletion). This runs as a cronjob.
I just the command
rsync -av --rsh='ssh -p90' --delete /backup/ email@example.com:~/dabackup/
root account on server one (
However on the first server the permissions on each of the subdirectories are set so that you can't get into them unless you are root (no execute permission on the folders), this is something I cannot change easily as it is how the backup software works.
This means that on the second server (
mydomain.com) the account
tentbackup doesn't have permission to go into the folders that rsync is creating resulting in the following errors
root@tent:~$ rsync -av --rsh='ssh -p92' --delete /backup/ firstname.lastname@example.org:~/dabackup/ building file list ... done 03-05-11/apache/ rsync: recv_generator: mkdir "/home/tentbackup/dabackup/03-05-11/apache" failed: Permission denied (13) *** Skipping any contents from this failed directory *** 03-05-11/bind/ rsync: recv_generator: mkdir "/home/tentbackup/dabackup/03-05-11/bind" failed: Permission denied (13) *** Skipping any contents from this failed directory *** 03-05-11/custom/ rsync: recv_generator: mkdir "/home/tentbackup/dabackup/03-05-11/custom" failed: Permission denied (13) etc...
I could work around this problem using
server two) but obviously I don't want ssh keys for the root account stored on
server one (
How do I safely allow
rsync permission to create these subfolders and files?
Even when logged into server two directly as tentbackup I cannot move into the directories or make files inside them
tentbackup@brave:~/dabackup$ cd 03-20-11/ bash: cd: 03-20-11/: Permission denied tentbackup@brave:~/dabackup$ mkdir 03-20-11/test -p mkdir: cannot create directory `03-20-11': Permission denied tentbackup@brave:~/dabackup$ touch 03-20-11/test touch: cannot touch `03-20-11/test': Permission denied