Re: Rsync and full path of filenames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Niki Kovacs wrote:
> Hi,
>
> rsync -av /etc/httpd/conf/httpd.conf destinationfolder/
>
> I get something like :
>
> destinationfolder/httpd.conf

This is normal because your copying a file not a tree

>
> QUESTION (at last) : is there a way rsync can somehow add the full file
> path, so the end result is more like :

Copy the tree and use something like includes or excludes or
even the files-from option to specifically include the files you
want to copy.

e.g.

[natea@us-cfe002:/etc]$ cat /tmp/files.txt
/etc/httpd/conf/httpd.conf
[natea@us-cfe002:/etc]$

[natea@us-cfe002:/etc]$ rsync -av --files-from=/tmp/files.txt / /tmp/
building file list ... done
etc/
etc/httpd/
etc/httpd/conf/
etc/httpd/conf/httpd.conf

sent 34853 bytes  received 40 bytes  69786.00 bytes/sec
total size is 34704  speedup is 0.99
[natea@us-cfe002:/etc]$ ls -ltr /tmp/etc/httpd/conf/httpd.conf
-rw-r--r--  1 natea natea 34704 Nov 18  2007 /tmp/etc/httpd/conf/httpd.conf


use the -n option with rsync for testing, to have it only show you
what it would do rather than doing it.


nate


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux