I want to make a backup of some specific files/folders of my $HOME to an external hard drive. I am using rsync with the following syntax:

rsync -avh --delete-excluded --exclude-from=.backup.lst $HOME/ BACKUP/

The backup.lst file includes the following:

    # Include
    + /Dev/
    + /Documents/
    + /Music/
    + /Pictures/
    + /.config/openbox/
    + /.config/tint2/
    + /.irssi/
    + /.mplayer/
    + /.backup.lst
    + /.bash_history
    + /.bash_profile
    + /.bashrc
    + /.conkyrc
    + /.fehbg
    + /.FehImage
    + /.htoprc
    + /.inputrc
    + /.rtorrent.rc
    + /.urxvtc.sh
    + /.vimrc
    + /.xinitrc
    + /.Xresources

    # Exclude
    - /*

Everything is synced properly except .config/openbox/ and .config/tint2/

a) Is there some way to include these two folders?

b) In general, is the above syntax correct to properly backup these files? I would appreciate getting any other suggestions regarding backup with rsync.

link|improve this question
feedback

1 Answer

Just tried similar case myself. Apparently you've got to include the parents at all depths, and also remove the unwanted children using - /<deep-parent>/* in a later exclude rule(s) (at all the depths).

# Include 
+ /.mplayer/
+ /.config/
+ /.config/openbox/
+ /.config/tint2/

# Exclude
- /*
- /.config/*

Man page says the .config/* would not be considered at all if you dont put just .config/ because of the exclusion of /*

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.