Need script that will copy the ownerships of files in a backup directory (rsync) and apply them to the original directory, the ownership of which has been mistakenly changed.
Posted on 2009-03-31
I need a script that will go through the backup directory and copy the ownership of each file and make a script that will restore ownership of those files. The script will have to begin in /home and then drill down, attaching the relative directories and putting them on the front of the filename. Something like the recursive 'ls -n' that goes through the backup directory would be great. The results would look like:
chown user.group /home/users/a/user/MyTrip.doc
For each file as I go down.