Adam Błaszczykowski
2015-Nov-18 10:46 UTC
Empty directories aren't backed up in backup-dir
Hello, We have strange issue with rsync and backup-dir option. In case of having empty directories and deleting them, those directories are not backed up in backup-dir directory. Directories are backed up only if contains files. Scenario: # mkdir -p source/b # rsync -a --backup --backup-dir=../backup source/ destination/ # rm -rf source/b # rsync -a --backup --backup-dir=../backup source/ destination/ # ls -la backup Backup-dir is empty. I expected to have ‘b’ directory inside. How can we force rsync to backup empty directories to backup-dir in case of deletion? Best Regards Adam Blaszczykowski -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20151118/a8081fb3/attachment.html>
Using the link-dest option would be one way to solve this. If you are seeking a backup system which uses hard links (link-dest), then you may wish to take a look at LBackup <http://www.lbackup.org> Hope this helps. -------------------------------------------------------------------- This email is protected by LBackup, an open source backup solution http://www.lbackup.org On 18/11/2015, at 11:46 PM, Adam Błaszczykowski <adam.blaszczykowski at gmail.com> wrote:> Hello, > We have strange issue with rsync and backup-dir option. In case of having empty directories and deleting them, those directories are not backed up in backup-dir directory. Directories are backed up only if contains files. > > Scenario: > # mkdir -p source/b > # rsync -a --backup --backup-dir=../backup source/ destination/ > # rm -rf source/b > # rsync -a --backup --backup-dir=../backup source/ destination/ > # ls -la backup > > Backup-dir is empty. I expected to have ‘b’ directory inside. > How can we force rsync to backup empty directories to backup-dir in case of deletion? > > > Best Regards > Adam Blaszczykowski > -- > 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
Apparently Analagous Threads
- where is backup-dir rooted?
- Help creating incremental backups using --backup-dir.
- Recycling directories and backup performance. Was: Re: rsync --link-dest won't link even if existing file is out of date (fwd)
- Recycling directories and backup performance. Was: Re: rsync --link-dest won't link even if existing file is out of date (fwd)
- command line to backup my documents to external drive