The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 06-02-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,886
Instead of --exclude, you can do --files-from=- to get from stdin the list of files to rsync. So you can do:

find /home/test/po -type l -print | rsync -rvcpogtl -e "ssh -p1223" --files-from=- /home/test/po username@hostname:/home >test.log

Be careful though and do a dry-run and a limited wet-run first. You have three different directories: the one find uses, the one rsync starts from, and the destination of rsync. Find outputs absolute path names, and combined with the -r option, this can have unexpected results. You might need to run find's output through sed to remove the starting path name, for instance.