View Single Post

   
  #6 (permalink)  
Old 01-16-2008, 11:23 AM
Frank Cusack
 
Posts: n/a
Default Re: Script to Copy Files Conditionally

On Wed, 04 Apr 2007 18:14:56 GMT ChrisQuayle <nospam@devnul.co.uk> wrote:
> Frank Cusack wrote:
>> On Wed, 04 Apr 2007 17:15:39 GMT ChrisQuayle <nospam@devnul.co.uk> wrote:
>>
>>>Frank Cusack wrote:
>>>
>>>>On Wed, 04 Apr 2007 16:21:08 GMT ChrisQuayle <nospam@devnul.co.uk> wrote:
>>>>
>>>>
>>>>>i need a short script to copy files from one drive to an archive
>>>>>drive. Have been using cmds like cp -pfR from one drive to another,
>>>>>but it would be more efficient if the copy were conditional on the
>>>>>date / time difference between source / destination file.
>>>>>
>>>>>Have been looknig for a way to do this, but am no script expert and
>>>>>any pointers to relevant commands or examples would be appreciated...
>>>>
>>>>
>>>>rsync
>>>
>>>Thanks. Just looked at that and will probably build and have a look,
>>>but really only need to mirror files on the same machine. A cron
>>>driven script would be more appropriate in this case...

>>
>>
>> 0 0 * * * rsync src dst
>>
>> -frank

>
> Thanks, but it's still overkill, when a one or two line script would
> probably get the job done just as well :-).


You may have lost me here.

How is a 1 or 2 line script LESS work or LESS overkill than a single
line cron entry. Here's your one line script:

--8<---
#!/bin/sh
rsync $1 $2
--8<---

Or does the smiley indicate you are joking?

> What happened to all the arcane skills of unix, a single tool to do a
> single job well, specialisation over generalisation etc, or has it all
> morphed into the bloatware that is modern Linux ?...


You've really lost me there. rsync is a single tool that does its
single highly specialized job quite well.

-frank
Reply With Quote