[Bug 3253] Feature request - Sync perms/ownership/time etc but with no file transfer

bugzilla-daemon at dp3.samba.org bugzilla-daemon at dp3.samba.org
Thu Nov 17 01:51:54 GMT 2005


------- Comment #2 from wayned at samba.org  2005-11-16 18:51 MST -------
Created an attachment (id=1575)
 --> (https://bugzilla.samba.org/attachment.cgi?id=1575&action=view)
perl script solution

I enjoy coding simple perl scripts like this, so here is a perl script that
will parse the output of "ls -lR dir [dir...]" or "ls -nR dir [dir...]" and
restore the permissions, owner, and group of all the files it finds.  You can
feel free to manually edit ls's output to remove unnecessary directories and/or
files, and then use the result to apply the listed attrs to another host's
files.  For instance, assuming the script "file-attr-restore" is somewhere in
the $PATH of server "remotehost", this sequence of commands would should update
the attrs on remotehost:

ls -lR /etc /usr/local/etc >saved-permissions
cat saved-permissions | ssh remotehost file-attr-restore

Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the rsync mailing list