|
Search Forums:
|
|||||||
| Forums | Register | Forum Rules | Linux and Unix Links | Man Pages | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
rsync exclude option
Hi Frdz,
i am using rsync to transfer files from source to destination. but i have one criteria like i have to tranfer only links from source to destination. in home/test/po folder i have kiran/test1 -> /home/test/lo/fg kiran/test2 -> /home/test/lo/fg2 like links are available. and i am running the following command. rsync -rvcpogtl -e "ssh -p1223" --exclude='?' /home/test/toDay/ username@hostname:/home > test.log what to place in the value of exclude option?? |
| Sponsored Links | |
|
|
|
#2
|
||||
|
||||
|
Instead of --exclude, you can do --files-from=- to get from stdin the list of files to rsync. So you can do: Code:
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. Last edited by Yogesh Sawant; 12-10-2010 at 05:05 AM.. Reason: added code tags |
| Sponsored Links | ||
|
|
![]() |
| Tags |
| rsync |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| rsync - exclude statement not working | em23 | Shell Programming and Scripting | 1 | 08-21-2008 06:47 PM |
| Creating and using a /.rsync/exclude | komputersman | Shell Programming and Scripting | 0 | 03-19-2008 05:13 PM |
| TAR : option to exclude absolute path | telco | UNIX for Dummies Questions & Answers | 1 | 06-19-2007 11:25 PM |
| rsync with the --delete option | sallender | UNIX for Dummies Questions & Answers | 1 | 10-22-2005 09:52 AM |
| rsync with the --delete option. | sallender | UNIX for Advanced & Expert Users | 2 | 10-21-2005 11:55 AM |
|
|