[CentOS] Rsync and full path of filenames
Lucian @ lastdot.org
lucian at lastdot.org
Wed Oct 28 18:24:37 UTC 2009
On Wed, Oct 28, 2009 at 5:18 PM, Niki Kovacs <contact at kikinovak.net> wrote:
> I have a bit of a tricky question about rsync.
> Let's say I want to backup a bunch of configuration files with rsync, in
> a script.
> What I don't want to do : a full snapshot of /etc.
> What I want to do : backup only those files I need, in an otherwise
> empty directory tree.
> In my script, I'd begin with a list of the files I effectively want to
> backup. Something like :
> Then I'd have some other files in /usr/local/bin and /usr/local/sbin,
> which I would like to backup too.
> Instead of a puzzling explanation, let me just show you how I would like
> my resulting backup to look like, so you get the idea :
> `-- httpd
> |-- conf
> | `-- httpd.conf
> `-- vhosts.d
> |-- site1.conf
> |-- site2.conf
> `-- site3.conf
> `-- local
> |-- bin
> | |-- script1.sh
> | `-- script2.sh
> |-- sbin
> |-- sbinscript3.sh
> `-- sbinscript4.sh
> Now if I do something like this :
> rsync -av /etc/httpd/conf/httpd.conf destinationfolder/
> I get something like :
> QUESTION (at last) : is there a way rsync can somehow add the full file
> path, so the end result is more like :
> destinationfolder/etc/httpd/conf/httpd.conf ?
> Any suggestions ?
> CentOS mailing list
> CentOS at centos.org
I don't think you can do that with rsync out of the box. You need to
script your way around it.
One thing I can advise is to use rdiff-backup, this one is based on
rsync and can create full-paths, as well as incremental backups (e.g.
you could restore a file and see how it looked 2 weeks ago).
Rdiff-backup should be available from RPMForge.
More information about the CentOS