Re: Script to Copy Files Conditionally On Wed, 04 Apr 2007 21:41:41 GMT ChrisQuayle <nospam@devnul.co.uk> wrote:
> Frank Cusack wrote:
>
>>
>> You've really lost me there. rsync is a single tool that does its
>> single highly specialized job quite well.
>>
>> -frank
>
> Not a windup, just the gut feeling that Solaris probably already has
> scriptable commands that would do such a simple job.
It does. I was just giving you the easiest possible method.
> Just looking for a solution that doesn't involve installing yet more
> software with attendant demons etc.
rsync doesn't need any daemon, etc., but I agree installing ever more
and more software is a PITA for smaller shops. rsync is a standard
tool, Solaris is deficient for not having it by default.
> If there isn't such a solution, then rsync does look like the way forward...
rsync is much easier, and much more efficient than any other method.
One example of how to do it with the built-in tools:
(cd src && find . -depth) | cpio -pdm dst
but then you have to do some moderate post-processing (on the output from
cpio) to exclude error messages about not copying files that are already
newer (while still reporting other errors).
If you have GNU tar (same problem with rsync though, you need addt'l
software), you can use the --newer option to get pretty close to what
rsync would do.
-frank |