Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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