Empty directories aren't backed up in backup-dir

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Empty directories aren't backed up in backup-dir

Adam Błaszczykowski

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
Reply | Threaded
Open this post in threaded view
|

Re: Empty directories aren't backed up in backup-dir

Henri Shustak
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 <[hidden email]> 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


--
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