gnu --target-dir, how to fake with rsync?

Martin Scharrer mailinglists at scharrer-online.de
Mon Oct 12 09:59:18 MDT 2009




Matt McCutchen-7 wrote:
> 
> On Wed, 2009-10-07 at 04:40 -0700, Martin Scharrer wrote:
>> I agree with both above points. However, I would also vote for adding
>> such
>> an option to rsync.
>> This should not be to difficult and would come in handy.
> 
> I'm not convinced of the need for a --target-dir option.  Do you have an
> example in which it would be significantly cleaner than --files-from?
> 
No, I actually do not have an example ready.
However, other tools like 'tar' have similar options (-C, --directory), so
'rsync' should support it as well.


Matt McCutchen-7 wrote:
> 
>> About the mentioned use of the option --files-from:
>> Sanjeev's earlier example:
>> 
>>   find ./ -type file -mindepth 3 -print0 | xargs -r0 cp
>> --target-dir=/home/sam/stuff/otherstuff/morestuff -
>> 
>> can be adapted to rsync like this:
>> 
>>   rsync -0 --files-from=<(find ./ -mindepth 3 -type f -print0)
>> /home/sam/stuff/otherstuff/morestuff
>> 
>> if you are using the BASH shell. Otherwise you have to write the output
>> of
>> 'find' into a temp file and use this for --files-from.
> 
> No, you can use stdin, as the man page description of --files-from
> mentions:
> 
> find ./ -mindepth 3 -type f -print0 \
> 	| rsync -0 --files-from=- /home/sam/stuff/otherstuff/morestuff
> 
> 
Thanks for pointing this out.

-- 
View this message in context: http://www.nabble.com/gnu---target-dir%2C-how-to-fake-with-rsync--tp25754312p25858300.html
Sent from the Samba - rsync mailing list archive at Nabble.com.



More information about the rsync mailing list