[clue] Rsync and root

chris fedde chris at fedde.us
Fri Nov 4 17:43:29 MDT 2011


cd source; sudo pax -w . | nc remote 1234567
then on remote
cd destination; nc -l 1234567 | sudo pax -ruvpe

Similar things can be done with tar and cpio rather than pax if you like.
Clocks should be roughly synchronized if the -u option is used.
Adding compression usually improves performance:

sudo pax -w . | gzip | nc ...
nc -l... | gzip -d | pax...

This technique works well for the seeding pass but not so much for
later passes when most files are already synched.  Pax -w can take
file names from stdin so it's not too hard to craft a command line
that uses find to select files newer than some tag file for subsequent
resyncing.   The motivated student could consider ways to use a shell
loop and cron to automate the synchronization process.

Shake well before using
cfedde

On Thu, Nov 3, 2011 at 7:51 PM, Jason Friedman <jason at powerpull.net> wrote:
> I am wanting to synchronize two filesystems, probably with rsync, and
> I want to include owner/group/permissions as part of the
> synchronization.
> Files could be owned by anyone, so ideally the command would be issued as root.
> For root to connect to another host as root, absent someone typing a
> password, SSH keys could be exchanged, or one can use RSH and .rhosts
> (unencrypted).
> If my organization discourages the use of RSH and discourages the use
> of exchanging root's keys (but accepts the exchanging of non-root
> keys), what are my options?
> _______________________________________________
> clue mailing list: clue at cluedenver.org
> For information, account preferences, or to unsubscribe see:
> http://cluedenver.org/mailman/listinfo/clue
>


More information about the clue mailing list