moving deleted files to a "trash bin" folder - Tools

This is a discussion on moving deleted files to a "trash bin" folder - Tools ; I'm trying to get rsync to move, instead of delete, files on the destination which have been deleted in the source. --delete option deletes files, whereas I was hoping with the -b option and using the backup dir and suffix ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: moving deleted files to a "trash bin" folder

  1. moving deleted files to a "trash bin" folder


    I'm trying to get rsync to move, instead of delete, files on the
    destination which have been deleted in the source.

    --delete option deletes files, whereas I was hoping with the -b option
    and using the backup dir and suffix options that the deleted files
    would be moved to the backup dir.

    I want to do this without having to resort to a rsync --delete -n
    | grep "^deleting " > deletedfiles.txt
    type thing. I could then
    move the files listed in deletedfiles.txt to a folder called trashbin/
    or whatever. This is inefficient and kludgy however...

    Is there a better way with rsync?

    Note, I definitely want to use --delete option as on a restore I don't
    want old files lingering about, but I DO want the option of getting
    back accidently deleted files. I am guessing this is outside the scope
    of rsync, as it is primarily a synchronise utility afterall.

    Anyway many thanks,
    Mike Youell.


  2. Re: moving deleted files to a "trash bin" folder


    mike@youell.net wrote:
    > I'm trying to get rsync to move, instead of delete, files on the
    > destination which have been deleted in the source.


    Interested in the same.

    Altough rsync is primarily a "sync" tool, I'm guaranteed to be directed
    towards it when asking about batching file moves (not sync) between
    servers.

    Archiving the files once they have been transfered is a requirement for
    us though so it looks like we are after the same thing.


+ Reply to Thread