Using remote rsync, but copy locally?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Using remote rsync, but copy locally?
# 1  
Old 10-03-2011
Using remote rsync, but copy locally?

I'm looking to use rsync to compare remote files and to copy the diff to a local directory, rather than transfer over the net.

The net connection is not fast enough to transfer these files (~1.8TB) and I'd like to sneakernet them instead.


Possible?
# 2  
Old 10-03-2011
Certainly you can rsync locally. Omit the user@host: part of the src/dest, and the rest stays the same. rsync [...] ./dir1 ./dir2

Be sure you get the permissions and timestamps preserved right when you carry over the files.
# 3  
Old 10-03-2011
I think he means "compare to remote, but don't copy the files over". In that case, use the --only-write-batch option of rsync, in addition to any other options. It will create 2 files, a shell script (really only 1 line) to apply the differences, and one larger containing the changed/missing files in some sort of stream.
These 2 Users Gave Thanks to pludi For This Post:
# 4  
Old 10-11-2011
pludi: That is exactly what I was after. Thank you so much!

I just found a page discussing the usage:

http://pavelmachek.livejournal.com/99670.html

rsync --only-write-batch=/mnt/usb/batchfile
move USB stick to remote side
rsync --read-batch=/mnt/usb/batchfile

I have to do some experimenting, but this seems to be really close to what I'm aiming to do.

Last edited by dfbills; 10-11-2011 at 02:30 PM..
# 5  
Old 10-28-2011
I've now got this working locally, but I need to be able to execute from a remote host.

This works on the source system:

Code:
rsync -av --only-write-batch=/mnt/usb/batch --stats /mnt/sync_sandbox/ remote-system.com:/mnt/sync_sandbox/

But this does not when run from the remote host, since it appears the the batch is relative to the system where the rsync originates:

Code:
rsync -av --only-write-batch=/mnt/usb/batch --stats source-system.com:/mnt/sync_sandbox/ /mnt/sync_sandbox/

Is there an easy way to get this to execute correctly? My source system doesn't have direct access to the remote system. I must originate the connection from the remote system to the source.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copy local files to single remote host but multiple folders using rsync

I'm trying to copy a file myfile.scr from my local Linux server to multiple folders on remote AiX server using single rsync command. Below command helps me copy the file "myfile.scr" from my localhost to a remote host folder "/app/deployment/tmpfiles" rsync --delay-updates -F --compress... (1 Reply)
Discussion started by: mohtashims
1 Replies

2. SCO

Rsync sometimes fails to copy

Hello I tried rsync (version 3.0.7) on OpenServer 5.0.7. Compile the version of samba.org and use of aljex.com. Both versions do not work reliably, sometimes show errors and stop copying (sometimes works) The OSR5.0.7 I'm using VirtualBox, I do not think the problem is in virtualization, but... (0 Replies)
Discussion started by: flako
0 Replies

3. Shell Programming and Scripting

SSH - remote output locally

The code below works ok, however; I need to output the results to a local variable the_path="/mnt/back/hang" ssh -T -i /home/buddy/.ssh/id_rsa buddy@ginger << EOF find ${the_path} -name "*.jpg" | wc -l > ## output to local variable exit EOF (3 Replies)
Discussion started by: squrcles
3 Replies

4. Shell Programming and Scripting

Editing a file on remote server using shell script locally

Hi Scott, My previous post was not for any school or college projects. I am currently working with a IT company (Cannot provide more details than this). I am trying to implement the below script in my day-to-day work, Apologies for the confusion in previous post :). My question remains same... (4 Replies)
Discussion started by: Nishant Ladiwal
4 Replies

5. Shell Programming and Scripting

Editing a file on remote server using shell script locally

Hi All, I have below requirements for my project: 1. Building a shell script which connects to a remote server 2. running script on local machine as user 'A' 3. connecting to server using user 'B' with password 4. login with a powerbroker role 'P' (asks for same password as 'B') on that... (1 Reply)
Discussion started by: Nishant Ladiwal
1 Replies

6. Shell Programming and Scripting

rsync copy files once

Hi This is my situation I have files on the left which I want to copy to the right. Once the files are copied to the right, they are processed and then deleted. The next time rsync runs I dont want it to copy the same files again, it should only copy any new files to the right. I have been... (4 Replies)
Discussion started by: duonut
4 Replies

7. Shell Programming and Scripting

Reading file from remote system and work on it locally

Hi! I am still fairly new to shell programming, but I have taken an interest to it and want to try some new stuff. I intend to make a shell script (using bash) to read a file on a remote system, then do some work on it on the local system and display it. In the long run I want to have a... (9 Replies)
Discussion started by: aaOzymandias
9 Replies

8. UNIX and Linux Applications

invoke remote graphical application..and display locally

Hi, I want to invoke(run) a graphical application remotely, and the display should be in remote itself. (no X redirect).i want to do this through ssh. like if i login to a remote machine and run firefox it should display there itself. how can i do this..? (2 Replies)
Discussion started by: madhusudankh
2 Replies

9. Solaris

Using RSYNC to copy files locally

Has anyone ever used rsync to copy files locally on one server? (in this case from one SAN volume to another). I am familiar with using rsync to copy files between servers, but not locally, I would usually use cp or or tar or something. Is rsync slower? Does it use additional overhead of the... (4 Replies)
Discussion started by: BG_JrAdmin
4 Replies

10. Shell Programming and Scripting

How to copy to server & delete locally?

Hi, I've got a cronjob running daily creating backup files. How can I send that created file to a remote server & then delete it on my workstation to save space? The filename format is as follows: proj_bk_20070624_15h30, proj_bk_20070625_15h30, etc tar cvf - /project | gzip -c > proj_bk_$(date... (3 Replies)
Discussion started by: mokgonec
3 Replies
Login or Register to Ask a Question