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

Automatically sync Documents folder to iDisk UNIX
Google searches for Sync iDisk largely show results that say something along the lines of "just edit the iDisk version." For me, iDisk is more about backup than anything else. I don't really have the need to share Documents with other people, and the local Documents folder of my laptop is always authoritative for my data. However, it would be nice to have a synced and restorable copy of my Documents "in the cloud" in the event my laptop fails. rsync works well for this.

My first step was to log into MobileMe, click the Account link, then to click on Storage Settings. Here I dropped my mail storage from 10Gb to 2Gb and ended up with an 18Gb iDisk, perfect for backing up my critical documents. Next, I wrote up a simple shell script to handle the rsync function and to copy the data from my local Documents folder to my iDisk's Documents folder.

The script is below: With the script saved and executable, simply run it with ./rsync_idisk.sh. The first run will take quite some time. (iDisk seems to only be giving up about 50Kbps these days, whereas it used to be 250Kbps or better). If you like, open another console and do a tail -f log_name and watch the files sync in real time. Additionally, opening up Finder and drilling in on the Documents folder under your iDisk will show "Syncing iDisk... Item x of x" in the bottom of the Finder window.

While this works well, it's still a manual process. The joy of rsync is that after the first (long) run, future iterations only sync over what's changed. This is where Lingon comes into play. Lingon allows you to schedule jobs to run at specific/recurring times via launchd (like cron on most other *nix systems). Download and install Lingon, then open a new item. I called mine com.apple.idisk.rsync. In the "What" section, enter the path to the script (ie: Macintosh HD/Users/MyName/scripts/rsync_idisk.sh), then set a time to run every so often. I chose every two hours.

For those who want a little closure, adding the following to the end of the script would email a copy of the log file to yourself, assuming you have a local mail server running.
cat $LOG | mail -s "Output of rsync to iDisk" user@domain.org
For the more advanced, a simple update to the script that would check for access to the internet could be used to only do the rsync if internet access is currently available.
    •    
  • Currently 3.27 / 5
  You rated: 2 / 5 (15 votes cast)
 
[76,607 views]  

Automatically sync Documents folder to iDisk | 13 comments | Create New Account
Click here to return to the 'Automatically sync Documents folder to iDisk' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically sync Documents folder to iDisk
Authored by: b3studios on Jul 23, '08 07:59:53AM

How is this *really* all that different that editing the iDisk version?
I just turned on iDisk sync - automatic in system preferences.
Then moved the files in my Users > Documents folder into my iDisk >Documents folder.
Created an alias of iDisk >Documents and placed it in my Users > Documents folder.

Edit and work from the local iDisk > Documents, and everything is synced up to the "cloud" within a few seconds of closing the edited file, creating a new one, or changing something.

Easy, and everything is backed up online (as well as to my other macs)

Please forgive my ignorance if I'm missing something crucial.



[ Reply to This | # ]
Automatically sync Documents folder to iDisk
Authored by: jochen K├╝pper on Jul 23, '08 12:33:51PM

Well, my iDisk is set to 20 GB storage size, and it currently holds several GB, sometimes about 15 GB or so...
My local Documents/ folder has about 3 GB and there are about 3 GB left on the hard drive of my MacBook.

How am I going to keep a local copy of the iDisk?



[ Reply to This | # ]
Automatically sync Documents folder to iDisk
Authored by: rhoerbe on Jul 24, '08 07:42:33AM

I was not happy with automated idisk sync. Some finder operations became very slow. And there are stories in the web, when .mac messed up some data. Rsync (or whatever other backup tool) gives better control.



[ Reply to This | # ]
Automatically sync Documents folder to iDisk
Authored by: Alrescha on Jul 23, '08 08:00:50AM

I apologize in advance, I just can't help myself:

Couldn't you just go into .Mac preferences and turn on iDisk syncing?
(I know, it's not *exactly* the same, but really...)

A.



[ Reply to This | # ]
Are you using the -u flag to avoid the WebDAV file modify time problem?
Authored by: rodneyweston on Jul 23, '08 09:18:07AM

When I load files to iDisk, the file modification date always changes to the time of the upload, rather than the true modify time of the file. This is a real nuisance and reduces the value of iDisk as a backup.

With a -u flag, you are telling rsync to not update files on the destination that have a modified date later than the source. That is fair enough as the files on the destination will always have a modify date greater than the source, unless the source was modified after the last upload....

Have I got this right?



[ Reply to This | # ]
Automatically sync Documents folder to iDisk
Authored by: b3studios on Jul 23, '08 01:52:30PM
well, are the files on your idisk duplicates of ones on your HDD?

outside of that I'd recommend this:
http://www.newegg.com/Product/Product.aspx?Item=N82E16822136197

great drive, great price

[ Reply to This | # ]
Apple's Backup?
Authored by: dan55304 on Jul 24, '08 06:57:20AM

Okay, what am I missing here? I use Apple's Backup to do the same thing but it also can handle my Address Book, Keychain, Mail, and other system stuff. All painless and automatic.

I too don't use .Mac for anything other than backup to a remote location. Apple's Backup utility also handles restore painlessly.

Please don't tell me all this kludge is to avoid paying a few $ for painless backup and restore.



[ Reply to This | # ]
Automatically sync Documents folder to iDisk
Authored by: joshuamgold on Jul 24, '08 08:45:24PM

Is there a dummy's guide to rsync? Can a regular person do what is being referred to in the hint? I tried downloading rsync, but when opening and looking at it, it seems very mysterious to use.



[ Reply to This | # ]
Automatically sync Documents folder to iDisk
Authored by: joshuamgold on Jul 24, '08 09:00:15PM

The reason I need to sync the local documents folder is that I need to access files using CITRIX and Citric doesn't "see" the idisk local as a folder or a volume for that matter. Therefore, if i want to attach a local document to an outlook email in Citrix, I cannot get to it. I do not have this problem with the local documents folder. I would like to have a copy in the cloud for whenever I need it...



[ Reply to This | # ]
Automatically sync Documents folder to iDisk
Authored by: chorcha on Apr 06, '09 05:14:38AM

Hi.

I think I carried out your instructions correctly.

I dropped the Folders from my HD>Documents folder into my iDisk>Documents folder.

I made an alias of those folders.

I dropped those new alias folders into my HD>Documents folder, and deleted the original folders that were in there, so as only to have the alias folders in this location.

I then deleted the alias folders from my iDisk>Documents.

SO now I have:

Mac HD>Documents>Alias Folders
IDisk>Documents>Original Folders (i.e. the ones I dragged from the HD in the first place)

I then open/save/edit from the iDisk>Documents and all is synched!

The only thing I have noticed is that after the syncing I get a "Sync Conflict" messages

The conflict says:
which file do I want to keep - "This Computer" or "MobileMe". If I select the "This Computer" option then everything is synced. When I tried it the other way round, i.e. "MobileMe", then the documents weren't synced, (when I downloaded the document from my MobileMe site, it wasnt updated)

Is there any reason for getting the iDisk Sync conflicts message?
Maybe its just a result of the way the iDisk has to be set up to make the syncing work.

Just wanted to check that I had followed your advice correctly. It seems to work aside from the sync conflict message, so thats the main thing I guess.

It was a good post you made!

Best



[ Reply to This | # ]
I can't get rsync script to compile
Authored by: ajvera on Sep 09, '09 12:19:42PM

I'm having some trouble here (I know it's an old thread, but I'm hoping someone out there can help me). I'm copying the script into AppleScript Editor, changing folder names appropriately, and the clicking Compile only to get the following - "Syntax Error Expected end of line, etc. but found "=". "

It highlights the first "=" in the script, after "export LOG"

Is there something I'm missing or doing wrong here?



[ Reply to This | # ]
I can't get rsync script to compile
Authored by: oliverraduner on Apr 04, '10 01:54:06PM
Is there something I'm missing or doing wrong here?
Yes, quite a bit:
This is no Apple Script, but it is a Shell-Command. This is like a different kind of Script-Application, used on Unix systems. You can get it run like this:
  1. Open Terminal (Applications > Utilities > Terminal.app)
  2. Type "pico rsync_idisk.sh" and press RETURN
  3. Copy-paste the Code to the Terminal-window
  4. Adjust the Code so it fits your needs (file-paths!)
  5. When finished, press CTRL+X - confirm the message with "Y" (= Yes, Save)
    (You can find now a file named "rsync_idisk.sh" in your User home)
  6. Proceed as described in the initial post by Supp0rtLinux...
  7. Hope this helps :) Cheers

    [ Reply to This | # ]
Automatically sync Documents folder to iDisk
Authored by: oliverraduner on Apr 04, '10 02:03:17PM
@Supp0rtLinux: I have no idea why everybody is bugging around here - this is just one awesome contribution & exactly what I was just looking for (...by stumbling upon the same issue with "Sync iDisk" on G00gle ;-)).

[UPDATE]
Funny thing: after I had the script working perfeclty, I found out that in the meantime Apple is officially providing an application to do this job: Apple's Backup.app

[ Reply to This | # ]