scp+find, a little help please

jan.muenther at nruns.com jan.muenther at nruns.com
Tue Jul 15 08:48:13 PDT 2003


Hi there,

> Need to set up scp to copy only newer files and directories between two 
> computers.
> 
> The basic setup is like:
> scp -pr user at host1:" host2:/dir
> 
> What would be a suitable "find command" here?

Erm, newer than *what*? find needs a file as a comparison parameter to
detetermine whether another file is newer than it or not. I assume you
mean you want to copy only files from host1 to host2 which exist on both
machines, with host1 potentially holding newer versions that should get
synchronized to host2. 

Before you break your neck with (absolutely well possible) scripting
solutions, I suggest you have a look at rsync, which uses SSH for
transport by default now as well.
Or maybe check out rdiff-backup, of which a port has just been submitted
(AFAIK) if a backup is what you're after:

http://rdiff-backup.stanford.edu/

Cheers, Jan


More information about the freebsd-questions mailing list