rsync a single file | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

rsync a single file

Shell Programming and Scripting


Tags
rsync single file

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-19-2010
timgolding timgolding is offline
Registered User
 
Join Date: Dec 2008
Last Activity: 4 November 2013, 5:24 AM EST
Posts: 83
Thanks: 10
Thanked 2 Times in 2 Posts
rsync a single file

I have been using rsync scripts for a while and use them to sync directories across my servers. However i need to set up an rsync script to copy only one file from a server. Is this possible with rsync? If so how would i do this? I have looked on examples on the internet and only see examples for whole directories.
Sponsored Links
    #2  
Old 10-19-2010
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 16 September 2014, 1:48 PM EDT
Location: Southern NJ, USA (Nord)
Posts: 4,412
Thanks: 8
Thanked 540 Times in 518 Posts
Well, the man says path is a dir. You could rsync the parent dir and set the filter to exclude all others or include only this file.

rsyncd.conf(5) - Linux man page

Another possibility is to work around it by putting the flat file alone in a new dir, and sym-link or link it to be acessible from the original path. Just note that a sym-link imposes a slight cost at open. While rsync of any kind of link may have various problems and restrictions, it will certainly work if both ends are single linked flat files in the new dir, and the original path has a sym-link to it. Whether the apps on both ends are happy opening the sym-links in orignal paths is an additional question.
Sponsored Links
    #3  
Old 10-19-2010
timgolding timgolding is offline
Registered User
 
Join Date: Dec 2008
Last Activity: 4 November 2013, 5:24 AM EST
Posts: 83
Thanks: 10
Thanked 2 Times in 2 Posts
Hi thanks,

Been playing around trial and error style and tried some things.

I tried:

Code:
rsync -avz host:/path/to/file/file.csv /path/to/file/file.csv

That seemed to only do the one file and the file looks like it updated. Thanks
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
unzip single file and untar single file sureshg_sampat Shell Programming and Scripting 2 02-25-2010 10:23 AM
rsync - update file on backup when file renamed on source coolatt Shell Programming and Scripting 2 02-08-2010 07:10 AM
rsync with particular file pattern jw_712 UNIX for Advanced & Expert Users 2 08-17-2009 08:40 PM
single quote problem with rsync mr_boysito Shell Programming and Scripting 9 12-05-2008 08:49 PM
Rsync file list hexaplus UNIX for Dummies Questions & Answers 3 08-29-2006 01:27 PM



All times are GMT -4. The time now is 05:44 PM.