Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I sync all my Desktop files to Dropbox, so that my desktop still feels, looks and works like a normal Desktop?

share|improve this question
    
Please be more specific, are you saying you want to assign you're desktop folder as the location of your dropbox. Because I think the closest you can come to that is placing your dropbox folder inside of your desktop folder –  rubixibuc Feb 17 '12 at 5:14
    
If you want you're desktop folder to be copied they're automatically you can write cron script that should be able to do that for you daily. –  rubixibuc Feb 17 '12 at 5:17
    
how to do the script? –  user494461 Feb 17 '12 at 8:34
    
Some of these solutions seem over the top. Expecially since on a previous Dropbox install, I had set the Desktop as the actual Dropbox folder on install. Now on a new OSX host, the setup mechanism insists on creating a folder called Dropbox in the folder you select. It would be more useful to setup the complete desktop folder directly as the Dropbox folder on my subscribed 50GB Dropbox account. –  user119762 Feb 23 '12 at 13:04
    
Can't you just remove the Desktop dir and replace it with a symlink to somewhere in the dropbox folder? –  houbysoft Oct 31 '12 at 0:35
add comment

2 Answers

up vote 4 down vote accepted

Using Folder Actions

This will – whenever you add a new file – synchronize your Desktop with a Dropbox folder of your choice. First, create the Dropbox folder where you want your desktop files to stay, e.g. ~/Dropbox/Desktop.

Then, open up Automator.app and create a new Folder Action. On the top, select your real Desktop.

enter image description here

To the Automator action, add a Run Shell Script action from the left pane. Paste the following.

rsync -rta --delete ~/Desktop/ ~/Dropbox/Desktop/

enter image description here

Save the action.

enter image description here

Now, this will run by default, and whenever an item is added to your Desktop, it will be mirrored with the Dropbox. If you delete an item from your Desktop, there will be no changes, so you have to add something (e.g. create a new folder and delete it right away) to force a sync.

If you ever want to disable it, right-click your Desktop icon from Finder, and select Services » Folder Action Setup. Here, uncheck your Desktop.

enter image description here


Using symlinks

For a more hacky approach, in OS X, you can use symlinks to link your Desktop to the Dropbox.

ln -s ~/Dropbox/Desktop ~/Desktop

However, be aware that from now on, everything you put on the Desktop will be automatically synced to the Dropbox folder. The drawback is that you won't be able to access the Dropbox context menu, as navigating to the symlink gets you back to the desktop.

I wouldn't really do this, as it's not that transparent.


Copying with cron

A very static, non-preferred way involves setting up cron. If you just want to copy the items, you can open your Terminal, and enter:

mkdir -p ~/Dropbox/Desktop
crontab -e

Then, paste the following, and save:

0   12  *   *   *   rsync -rt --delete ~/Desktop/ ~/Dropbox/Desktop/

This will make a backup every day, at 12:00. You can change the 12 to * to do this every hour. To disable it again, enter crontab -e and delete this line, then save.

share|improve this answer
1  
Your symlink params are backwards: ln -s ~/Dropbox/Desktop ~/Desktop –  user72923 Jul 31 '12 at 23:58
    
Seems like a better idea.. thanks! –  slhck Aug 1 '12 at 7:04
add comment

I prefer the symlink method, but when setting up additional Mac's to share the sync, it can get tricky.

First, I have a folder in Dropbox dedicated to "osx sync" ... e.g.: sync_osx

  • Before I setup the symlink on the new Mac, I temporary "move" the Desktop folder out of the sync_osx (but still inside the main DropBox folder).

  • I then open Terminal and type:

    cd ~/Dropbox/sync_osx

    ln -s ~/Desktop/ Desktop

  • Finally, I move the files back into the newly created Desktop folder in ~/Dropbox/sync_osx/Desktop.

By moving the files within the Dropbox folder, Dropbox quickly syncs and file change history remains intact.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.