Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Sync to a remote machine without using the CLI Network
I've read a dozen hints on related topics, but haven't seen anything that deals with precisely this issue. I have an iMac at work and a PowerBook at home. I wanted to keep the two machines in sync, but without lugging the PowerBook into the office. I also wanted to do this without opening the Terminal.

My criteria meant that the obvious (but not necessarily easy) solution, rsync, was ruled out. Folks suggested rsyncX, psync, and Unison, but I was most convinced by the arguments in favor of Chronosync. Chronosync costs money, but it does exactly what I need it to: it gives me all the power and flexibility of rsync, but with a nice, polished GUI.

But Chronosync has one significant limitation: it can only sync two volumes that one can mount locally. All the Chronosync documentation (which is quite thorough, by the way) presumes that you have two locally-mounted volumes, either over a LAN or through FireWire, etc. But, you'll recall I didn't want to haul the PowerBook into the office.

I thought I'd have to drop my 'no CLI' condition and turn to rsync, but then I read this hint on a related but different topic, and found the suggestion from jctull (scroll down a bit) about how to use SSH Tunnel Manager. Thus, the solution to my problem was to do the following:
  1. Use Tunnel Manager 2.0 to create an ssh tunnel from the PowerBook at home to the iMac at the office.
  2. Set up Tunnel Manager (following jctull's instructions in the above hint's comments) to forward port 10548 on the powerbook to port 548 (afp) on the iMac.
  3. Connect to localhost:10548, which mounts the iMac drive as an AFP volume on my PowerBook.
  4. Launch Chronosync, set up the sync, and go from there!
This all seems simple enough, and is a breeze to use now that it's set up. But I was rather surprised that no one had mapped out any sort of simple instructions to sync two machines not on a LAN without using the command line. My next step would be to automate this process with an AppleScript, but as you can likely tell from above, I'm not much of a programmer. Any suggestions greatly appreciated.
    •    
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[19,155 views]  

Sync to a remote machine without using the CLI | 21 comments | Create New Account
Click here to return to the 'Sync to a remote machine without using the CLI' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Sync to a remote machine without using the CLI
Authored by: macHobbes on Mar 23, '06 07:42:47AM

Well, I have done exactly that using ChronoSync, and nothing else.

I set up a synchronizer document where one target is on the remote volume (which has to be mounted to set up the document, of course).
Clicking the Options... button in the target field and entering your user name and password, this document will then mount that volume all by itself whenever it is run. So, the next time ChronoSync will run that document, the volume will mount automatically, provided the server is available. No extra intervention is necessary.

But maybe I am missing something?



[ Reply to This | # ]
Sync to a remote machine without using the CLI
Authored by: DougEdwards47 on Mar 23, '06 08:43:49AM

I too use Chronsync, but why not just mount the remote machine's disk on the desktop of the local machine?

Actually, what I do is to use a firewire portable disk as an intermediate - sync between the disk and the laptop which is usally at home and then carry the disk to work and sync between the disk and the desktop machine at work.



[ Reply to This | # ]
Sync to a remote machine without using the CLI
Authored by: rbenezra on Mar 23, '06 09:04:15AM

The automation would involve 3 steps:

1. launching the tunnel 2. mounting the volume 3. syncing

Since SSH Tunnel manager is scriptable, this should be possible but I haven't figured out the syntax...anyone?

2. This script will mount the volume if you are remote and tunneled (as you wanted) ; you need to add your own username and password and computer name where indicated; also save as run only script so the password can't be lifted:

try
set the disk_URL to "afp://" & "username" & ":" & "password" & "@127.0.0.1:10548/" & "computer name"
mount volume disk_URL


on error error_msg
display dialog error_msg buttons {"OK"} default button 1
end try

3. With Chronoscript you have the option of launching this Applescript prior to the sync to mount the volume (or you can run Chronosync from within this script itself if you can figure out the syntax).

I know this is not complete but, hey, its a start. I'd really like the SSH Tunnel manager syntax if anyone knows it.



[ Reply to This | # ]
A bit more of the script
Authored by: fronesis on Mar 23, '06 04:33:44PM

OK, thanks for the start. Here's what I've got to add to it.

SSH Tunnel Manger will automatically make a connection upon launch, and Chronosync can be scheduled to sync on launch. So we can do 1 and 3 fairly easily.

The one problem I've got: how to submit the password for Tunnel Manger within the applescript???

I've worked around this by writing in a delay, which gives me this:


try

tell application "SSH Tunnel Manager" to launch
delay 30

set the disk_URL to "afp://" & "username" & ":" & "password" & "@127.0.0.1:10548/" & "hard disc name"
mount volume disk_URL

tell application "ChronoSync" to launch


on error error_msg
display dialog error_msg buttons {"OK"} default button 1


end try

So, does anyone know how (or if it's possible) to put input the password through the script? With that, the whole thing would be automated.



[ Reply to This | # ]
followup
Authored by: fronesis on Mar 23, '06 09:07:43AM

A quick clarification: yes, Chronosync does allow you to connect to a 'remote server'. However, this is used to mount an AFP volume (not FTP or other), which means that you need to be able to access this volume through AFP, and that means over your LAN. (in other words, in my case, connecting to a machine not on my LAN, the server is never available from Chronosyn's perspective).

Thus, if both machines are on the same local network, this hint isn't necessary at all (Chronosync is all you need). Also, if you want to use a firewire drive as an intermediary, then you also don't need this hint.

However, I wanted to skip the step of carrying a drive back and forth, AND my machines aren't on the same LAN. For this application, the extra step of the SSH tunnel is necessary.



[ Reply to This | # ]
followup
Authored by: macHobbes on Mar 23, '06 09:58:11AM

I see.

In my case, I am accessing my mac in my office, so I am using the AFP protocoll, and it does not make any difference whether this mac is local or remote. -- I was not aware of that.



[ Reply to This | # ]
followup
Authored by: stewarsh on Mar 24, '06 11:42:19AM
I'm assuming that one of your machines is behing a firewall? If not, I'd like the point out that AFP does work over the internet. You just need to know either the DNS fully qualified name or the IP address. For example:
afp://myhost.mycompany.com/harddrive


[ Reply to This | # ]
followup
Authored by: fronesis on Mar 25, '06 02:40:12PM

Yes, good point.

And yes, my work machie is behind a firewall, so the tunnel is necessary for me.



[ Reply to This | # ]
Sync to a remote machine without using the CLI
Authored by: laurion on Mar 23, '06 10:22:18AM

I prefer Deja Vu. It has the ability to mount a remote drive already. I tried Chronosync, but found it to be more cumbersome, and slower, although I'll admit that I didn't time them. The advantage of running through the tunnel, as in this hint, is security as well.



[ Reply to This | # ]
Sync to a remote machine without using the CLI
Authored by: aaronfaby on Mar 23, '06 10:41:16AM

Why is everyone afraid of the shell?

---
Great Mac Hosting - http://www.serverlogistics.com



[ Reply to This | # ]
Sync to a remote machine without using the CLI
Authored by: mistersquid on Mar 23, '06 07:26:02PM

I'm with you on this. Going through all these contortions because one is afraid of opening the Terminal is like taking a bus and transferring multiple times instead of just driving there using one's own vehicle.*

Just the fact that you're portmapping your tunnel using a GUI tool seems ridiculous to me when you can open up a Terminal window and type

ssh -L 10548:127.0.0.1:548

Your next step would be to invoke rsync at the command line. You could even save this as a shell script and forget the syntax if you wanted to.

Imagine someone so used to the CLI that she or he insisted everything be done without using the GUI. Each tool has its drawbacks and benefits.

*And, yes, I like my failed vehicular analogy very much, thank you.



[ Reply to This | # ]
Glitches
Authored by: ssevenup on Mar 23, '06 11:00:21AM

I have looked at many sync solutions for syncing and all have had glitches. Sometimes bits and pieces of bundles get left behind on deletion. Sometimes the app bundle is turned into a directory, and sometimes the label status is lost. I have never found anything free of problems.

---
Mark Moorcroft
ELORET Corp. - NASA/Ames RC
Sys. Admin.



[ Reply to This | # ]
Glitches
Authored by: Herve5 on Mar 26, '06 07:06:28AM

I use Synk which I find makes a special effort in preserving rights, labels etc.

Mature application, nice GUI, with some features very important to me like the possibility of previewing what'll happen (and even fine-tuning one doc at a time if needed), archiving deleted files, maintaining daily/weekly/... grandparent archives etc.

Now, it too will only automount LAN volumes :-)
(but can trigger pre- and post- applescripts to start tunneling)

Hervé



[ Reply to This | # ]
Sync to a remote machine without using the CLI
Authored by: mubarak on Mar 23, '06 06:20:48PM

FWIW, I sync my PB at home to my work PowerMac. PB is connected via Airport Extreme to a base station connected to a cable modem. Work PowerMac has ethernet connectivity. Since both get IP addresses via DHCP, DNSUpdate and dyndns.org are a godsend.

I use Now Up-to-date to sync them each night, but NUTD is a pain in the neck to do this. After a long time, I have managed to come up with an exclude file that will allow most syncs to complete without errors.

Perhaps I should use Tunnel Manager so my data are secure.



[ Reply to This | # ]
Sync to a remote machine without using the CLI
Authored by: stewarsh on Mar 24, '06 11:53:15AM

I actually use Unison for this task since I actually sync several machines at various points during the day. My biggest complaint with Unison is that it doesn't sync the meta-data attached to each file so makes Spotlight less useful. Reading that Chronosync does sync this data I dediced to check it out.

Unfortunately I was disappointed. In my little test, it does sync the data provided there was another change. The change the meta-data alone is not enough for Chronosync to find a difference that needs to be updated. That blows it's usefulness for me given that my Unison syncs are automated and managed by a cronjob.

Anyway, didn't mean to rant, but wanted to let others know if they are in a similar situation. I've e-mailed the developers asking if this could be added. If so, they have another customer.



[ Reply to This | # ]
Sync to a remote machine without using the CLI
Authored by: tinker on Mar 24, '06 08:41:54PM

Actually, I signed up for Foldershare (www.foldershare.com) to do exactly this. It puts a menubar-accessible local utility on each of my computers. I tell it which folders to sync via the online interface, and whenever two computers are online at the same time, they sync, very quickly and very efficiently. I've basically been able to forget about syncing laptop and desktop.

It works so quickly that I can use it for teaching. I write up my seminar notes on my desktop, grab my laptop, walk to class, pop open the laptop, sign in, and within a few moments -- usually so few that they're not even noticeable -- the same document is available in the same folder on my laptop, without my having to do a thing. Utterly brilliant. And cross-platform. And free.

The first question I usually get asked is, "Yeah, it's free now, but when do they start charging?" Oddly enough, they used to charge, but they were bought out by Microsoft, and now it's free. I don't know whether they plan to start charging -- I hope not. But time will tell.



[ Reply to This | # ]
Transmit
Authored by: Interactive on Mar 25, '06 03:36:38PM
I have a Mac in my office at work behind a firewall. VPN is used to get through the firewall. I use Transmit with a SFTP setting and specify the IP address of my office Mac. Then, I can synchronize two corresponding directories at a time from within Transmit between my home Mac and office Mac.

It cannot set up a schedule, but it helps me do a simple synchronization.

[ Reply to This | # ]
Why go to all this trouble when you can use a one-liner
Authored by: Lectrick on Mar 26, '06 10:16:17AM

I will preface this by saying that rsync on OS X has had problems in the past. In fact, the most recent OS update fixed an rsync delete issue (perhaps because I complained to Apple about it). But here's how I do a local backup (this can easily be adapted to a backup over the Internet if you specify the source and dest paths correctly, and tunneled over SSH too if you want, see "man rsync").

/usr/bin/rsync -a --delete --partial --extended-attributes --exclude /.* --exclude /dev/* --exclude /Desktop* --exclude /*Volume* --exclude /Network* --exclude /private/var/vm/* --exclude /private/var/tmp/* --exclude /private/tmp/* / /Volumes/backupvolumename/

Schedule via "cronnix" and you're off... The --extended-attributes option is the one that ensures resource forks are copied. If you want to test it on the commandline first to ensure it's doing the right thing then add the --progress option and test it on a small directory.

---
In /dev/null, no one can hear you scream



[ Reply to This | # ]
Why go to all this trouble when you can use a one-liner
Authored by: sckz on May 24, '06 06:07:09PM

Indeed. Rsync works fine. But now a security issue.
I'd like some clients to be able to use rsync to backup their files of a project to my server using rsync. They have a user account on my server. But to let them use rsync, I have to give them shell access. And that scares me. They can go everywhere using SSH and also see other client's files.

Is there any way to let a client use rsync but not let him have SSH access? I already limited the access by using a wrapper that only accepts the rsync command, but rsync has the feature of showing file lists - and those show again all file names in the server.

What do you mean with tunneling?

All help greatly appreciated!

Jonathan Richter

My Server: Mac mini with OS X server 10.4



[ Reply to This | # ]
Why go to all this trouble when you can use a one-liner
Authored by: kd4ttc on Oct 05, '06 05:30:40PM

At this point you need to give your users public key authentication so they can log in without user passwords. You should want then to use SSH. They possibly might have something in their files that would compromise your system, such as notes they took on logging in to your computer. The way to protect your system is by setting permissions correctly for each user that is logging onto your system. Without limiting permissions you have a very vulnerable system.

---
Steve Holland



[ Reply to This | # ]
Sync to a remote machine without using the CLI
Authored by: Ptarmigan on Jan 13, '11 08:21:00AM

Thank you for this solution for using ChronoSync through a firewall! I've been hunting for a solution for days, and this works perfectly. It might be slightly more clunky than just ChronoSync alone, but what can you do when your sysadmins are so paranoid about security that they put your laptop in a DMZ? And beats running rsync in 2 directions which is a completely rubbish solution for todays typical user who deletes files, moves folders etc on both laptop and desktop. All of which ChronoSync copes with perfectly and rsync doesn't.

A brief summary of what I have to do to get laptop and desktop to sync, after installing ChronoSync on my Laptop:
1) switch on my VPN connection, which bypasses a gate
2) Set up SSH tunnel to my desktop as described
3) Mount Desktop from Laptop
4) Run my prepared ChronoSync file

Not perfect solution, but pretty passable. Now fingers crossed the sysadmins don't come knocking on my door to see what I've been up to, but I think it's all legal!



[ Reply to This | # ]