0

i want to make backups of specific subdirs in my users home directories. For example the typical home dir looks like:

\home\alice\backup
\home\alice\something_else
\home\bob\backup\
\home\bob\trivia

...

and i would like to preserve the directory structure, but backup only the backup dirs

i tried with

backup /home/*/backup homes/

but that failed. any help would be greatly appreciated

edit: additional info: this is being done on a centos 5.9 machine with a normal install of rsnapshot; the backup like i refer to is the rsnapshot.conf line.

i can only assume it uses rsync.

to further explain my question, i am interested in what is the correct syntax for the rsnapshot.conf file, to backup only a single subdirectory of all user directories in home.

liskawc
  • 51
  • 8
  • It's unclear what you're asking. What is your OS? Where does the `backup` program come from? Custom script? And how did your attempt fail? – Andrew Schulman Jan 20 '14 at 18:33

1 Answers1

3

I found the solution, if anyone is interested.

Instead of writing the includes and excludes in the rsnapshot.conf file, you should make include and exclude files. You then specify in the conf which are which.

So your conf file looks like this:

#include    ???
#include    ???
#exclude    ???
#exclude    ???

include_file    /etc/include.txt
exclude_file    /etc/exclude.txt

and the include and exclude files look like this

include:

/home/*/backup

exclude:

/home/*/*
Undo
  • 311
  • 6
  • 19
liskawc
  • 51
  • 8