Results 1 to 10 of 10
Hello
I have a text file which has full path to the files such as
cat list.txt
/etc/hosts
/etc/resolve.conf
I would like to incorporate this will rsync to copy/update changes ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-11-2011 #1Just Joined!
- Join Date
- Aug 2009
- Location
- Toronto
- Posts
- 34
rsync list of files
Hello
I have a text file which has full path to the files such as
cat list.txt
/etc/hosts
/etc/resolve.conf
I would like to incorporate this will rsync to copy/update changes to another directory.
How can I go about doing that?
I have tried using the following
but it doesn't work! can someone help??Code:rsync -avc `cat list.txt' /backup
Thank you
- 08-11-2011 #2saysCode:
man rsync
--files-from=FILE
This should be waht you want.You must always face the curtain with a bow.
- 08-11-2011 #3Just Joined!
- Join Date
- Aug 2009
- Location
- Toronto
- Posts
- 34
I have tried that, but no luck, it keeps complaining about some errors, any other way to do it?
- 08-11-2011 #4
--files-from works.
It would be helpful if you show, what you did and what the error exactly is (in CODE tags plase).You must always face the curtain with a bow.
- 08-11-2011 #5Just Joined!
- Join Date
- Aug 2009
- Location
- Toronto
- Posts
- 34
if I run the following
rsync -avnc --files-from=list.txt /tmp
I get a dump of rsync help options!!
- 08-11-2011 #6
ah ok.
You need to provide a source, even if the files are actually picked from the file list.
Btw, the man page does show this
: The SRC is never optional.
In your case, /etc might be a good source.
The filelist then needs to be relative to /etc.
A source of / is possible, and then you could use absolute paths in your filelist.
But I wouldnt recommend that.
A small mistake and you might end up rsyncing your whole system.You must always face the curtain with a bow.
- 08-11-2011 #7Just Joined!
- Join Date
- Aug 2009
- Location
- Toronto
- Posts
- 34
rsync -avnc --files-from=list.txt /tmp
it dumps rsync help to the screen and it doesn't sync anything ...
- 08-11-2011 #8
As I said.
You need to
1) provide a SRC. In the example, I used /etc
2) adjust your list.txt, so that the files are relative to SRC
Code:rsync -av --files-from=list.txt /etc/ /tmp
You must always face the curtain with a bow.
- 08-11-2011 #9Just Joined!
- Join Date
- Aug 2009
- Location
- Toronto
- Posts
- 34
it worked! you are the man

it is very tricky, I have to admit , and I had to provide full path for --files-from and source and dest
Thanks your input ...
This was one of the error I was running into while I was trying to get it to work.
root@ubuntu:/tmp# rsync -av --files-from=/root/list.txt /etc/ /tmp
building file list ... rsync: link_stat "/etc/etc/hosts" failed: No such file or directory (2)
rsync: link_stat "/etc/etc/resolv.conf" failed: No such file or directory (2)
done
- 08-12-2011 #10Just Joined!
- Join Date
- Aug 2011
- Posts
- 11
As Irithori said:root@ubuntu:/tmp# rsync -av --files-from=/root/list.txt /etc/ /tmp
building file list ... rsync: link_stat "/etc/etc/hosts" failed: No such file or directory (2)
"/etc/hosts" (which is in your list.txt file) is NOT relative to your source (which is /etc/). All file names starting with "/" are absolute path/file names. You have to replace "/etc/hosts" with "./hosts" or just "hosts" or "../etc/hosts" when using /etc/ as source.2) adjust your list.txt, so that the files are relative to SRC


Reply With Quote
