Hi, I am using rsync to backup files. Is it possible to specify an option not to delete files from backup directory if the files are deleted from source? In that way, I can always keep something I may or may not need in the backup disk, but remove it from a work computer. Thank you. Kind Regards. hce
Would that not be done by omitting the --delete option? aF On 12/08/2010, at 9:52 AM, hce wrote:> Hi, > > I am using rsync to backup files. Is it possible to specify an option > not to delete files from backup directory if the files are deleted > from source? In that way, I can always keep something I may or may not > need in the backup disk, but remove it from a work computer. > > Thank you. > > Kind Regards. > > hce > -- > Please use reply-all for most replies to avoid omitting the mailing list. > To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
> I am using rsync to backup files. Is it possible to specify an option > not to delete files from backup directory if the files are deleted > from source? In that way, I can always keep something I may or may not > need in the backup disk, but remove it from a work computer.As Alex mentioned the omitting the --delete option is the way to go. However, you should keep in mind that (depending upon the rsync options you provide) if you update a file (within the source directory) the then older version of this file in the destination directory will be overwritten. If you want to preserve old revisions of files, there are various rsync options which will allow various actions to be take place to the older versions which already exist in the destination directory. Below is an example of what I am talking about with regards older versions being overwritten in the destination directory when using the --archive rsync option.> $ mkdir 1 2 > $ ls > 1 2 > $ touch 1/hello > $ rsync -a 1 2 > $ echo "hello there" >> 1/hello > $ rsync -a 1 2 > $ cd 2/1 > $ ls -a > . .. hello > $ cat hello > hello thereYou will notice that there is no copy of the original (blank) file only the more recent version which contains the "hello there" text. If you check the rsync manual page and perform some www searches, you will find many options and approaches relating to what happens to updated files/directories when you run rsync. ---------------------------------- This email is protected by LBackup http://www.lbackup.org
hce wrote:> I am using rsync to backup files. Is it possible to specify an option > not to delete files from backup directory if the files are deleted > from source? In that way, I can always keep something I may or may not > need in the backup disk, but remove it from a work computer.Perhaps you want the --backup --backup-dir=DIR options? -b, --backup make backups (see --suffix & --backup-dir) --backup-dir=DIR make backups into hierarchy based in DIR Bob
Thanks all responses. That works fine. Kind Regards, hce On Thu, Aug 12, 2010 at 10:23 AM, Alex Ferrara <alex at receptiveit.com.au> wrote:> Would that not be done by omitting the --delete option? > > aF > > On 12/08/2010, at 9:52 AM, hce wrote: > >> Hi, >> >> I am using rsync to backup files. Is it possible to specify an option >> not to delete files from backup directory if the files are deleted >> from source? In that way, I can always keep something I may or may not >> need in the backup disk, but remove it from a work computer. >> >> Thank you. >> >> Kind Regards. >> >> hce >> -- >> Please use reply-all for most replies to avoid omitting the mailing list. >> To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync >> Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html > >
Seemingly Similar Threads
- Help creating incremental backups using --backup-dir.
- rsync algorithm
- Empty directories aren't backed up in backup-dir
- command line to backup my documents to external drive
- Recycling directories and backup performance. Was: Re: rsync --link-dest won't link even if existing file is out of date (fwd)