including files in a symlink directory when backing up with duplicity

8

I'm backing up using Duplicity, great tool. I'm unable to include files in the backup that are within a directory that is a symlink.

Using the following:

duplicity <dup args> --include /var/www/**/current --exclude '**'

duplicity will only backup the symlink I've tried:

duplicity <dup args> --include /var/www/**/current/* --exclude '**'
# and
duplicity <dup args> --include /var/www/**/current/** --exclude '**'

Not even then symlink is backed up.

the "current" directory links to directory like: /var/www/host.com/de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3

The files contains a few static html & css files. I want those files to be backed up, regardless of which sha'd directory "current" points to.

Any help appreciated.

Rob

Posted 2012-10-04T14:49:54.983

Reputation: 649

Answers

12

Duplicity doesn't follow symlinks by design. This is because if you tried to restore from that, it'd restore the actual files, and not a symlink! It's not a very good backup if it doesn't restore things to the way they were before. It should, however, be able to backup the symlink itself, and then you should make a backup of the symlink'd data separately.

Darth Android

Posted 2012-10-04T14:49:54.983

Reputation: 35 133

Yeh my script just need to be a little smarter about the way it decides what's going to be included. Thanks for the information. – Rob – 2012-10-05T15:41:51.160

1

Starting with Duplicity 0.8, the --copy-links flag should do exactly what you want: https://code.launchpad.net/~horgh/duplicity/copy-symlink-targets-721599

This allows us to dereference and include what symlinks point to in our backup.

I named the argument --copy-links. This is the name rsync gives to a similar flag.

ziedaniel1

Posted 2012-10-04T14:49:54.983

Reputation: 21