I would like to backup the following folders with duplicity
/home
/etc
/usr/local
/root
/var
/boot
and exclude
/var/tmp
/var/run
/var/lock
/home/*/.thumbnails
/home/*/.cache
/home/*/.local/share/Trash
/root/.thumbnails
/root/.cache
/root/.local/share/Trash
I already learned that I have to specify one source directory to save and that I can adjust that with include
and exclude
options.
So, I could give /
as source directory and exclude **
(which would sum up to nothing) and include the folders that I want to save.
Source /
and --exclude /
would give en empty set, --include ...
beats the exclude
and adds the folders. But then, I will not be able to exclude the folders I want to exclude, right? Or am I missing something?
I've found out that the include/exclude commands get "stronger" the more left they appear in the command.
In my case, the imports and exports and the source would look like this: --exclude /var/tmp --exclude /var/run --exclude /var/lock --exclude /home/*/.thumbnails --exclude /home/*/.cache --exclude /home/*/.local/share/Trash --exclude /root/.thumbnails --exclude /root/.cache --exclude /root/.local/share/Trash --include /home --include /etc --include /usr/local --include /root --include /var --include /boot --exclude '**' /
(With added newlines:)
--exclude /var/tmp
--exclude /var/run
--exclude /var/lock
--exclude /home/*/.thumbnails
--exclude /home/*/.cache
--exclude /home/*/.local/share/Trash
--exclude /root/.thumbnails
--exclude /root/.cache
--exclude /root/.local/share/Trash
--include /home
--include /etc
--include /usr/local
--include /root
--include /var
--include /boot
--exclude '**'
/
To complete the answer of @Kurtibert, you need to add **
at the end of the directory you include to be sure files inside are included (and don't forgot the quotes):
--exclude '/var/tmp'
--exclude '/var/run'
--exclude /var/lock'
--exclude '/home/*/.thumbnails'
--exclude '/home/*/.cache'
--exclude '/home/*/.local/share/Trash'
--exclude '/root/.thumbnails'
--exclude '/root/.cache'
--exclude '/root/.local/share/Trash'
--include '/home/**'
--include '/etc/**'
--include '/usr/local/**'
--include '/root/**'
--include '/var/**'
--include '/boot/**'
--exclude '**'
/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With