Originally Posted by sjau
try: man rsync and look for the permission/ownership switch. I think it should be: -avpz
Thanks, but the problem is this the "-p" preserves the source
permissions (a good thing) but the "-o" and "-g" also preserve the source owner and group (not what I want). What I want is some miraculous switch that inherits parent details from the destination directory!
I suppose the answer is to move all the crontab rsync tasks to a script and add the following lines after each one:
$ /usr/bin/rsync -avpz --delete --exclude-from="/root/rsync/excludes" -e "ssh -i /root/rsync/mirror-rsync-key" firstname.lastname@example.org:/var/www/web13/ /var/www/web6/
$ chown -R web6_username /var/www/web6
$ chgrp -R web6 /var/www/web6
Should work, I think, although how I am going to cope with having two sets of users and webs with different names on both servers...