copy a bunch of rile, then delete from source

Ugo Bellavance ugob at lubik.ca
Fri Apr 11 12:42:30 UTC 2008


Cameron Simpson wrote:
> On 10Apr2008 16:12, Ugo Bellavance <ugob at lubik.ca> wrote:
>>    Here is what I want to do:
>>
>> - Copy a number of files (using a wildcard, like logapplication*.tar.gz) 
>> from one server to another
>> - Once done, I want to delete the files from the source server.
>>
>> The first step is easy to do... ssh keys, cronjob, and scp.  However, can I 
>> be sure that the file has been copied successfully?  I thought of comparing 
>> md5sums source/destination before deleting the source.
>>
>> Could rsync be of help?
> 
> Yes. See the --remove-source-files option in "man rsync". It does
> exactly what you are asking for.
> Did you even bother to read "man rsync" before asking this question?

Yes, I did read it. I still wasn't sure of the expected result.  I could 
have tested it thought.

It is --remove-sent-files

        --remove-sent-files
               This  tells  rsync  to  remove  from  the sending side 
the files
               and/or symlinks that are  newly  created  or  whose 
content  is
               updated  on the receiving side.  Directories and devices 
are not
               removed, nor are  files/symlinks  whose  attributes  are 
  merely
               changed.




More information about the redhat-list mailing list