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.

I've been reading a lot of information on this and yet I'm still unsure if its possible.

What I want to achieve is: sync a folder that is outside Dropbox and any changed to that folder or the files within get mirrored to the Dropbox folder and the Dropbox server.

This is what I've tried: I've install Link Shell Extension. Picked a folder with 10 pictures inside and created a junction for it inside the Dropbox folder. When I delete a pictures from inside the original folder (outside Dropbox) the change is reflected in the Junction folder inside Dropbox Folder, not on the server.

The exact same behaviour with the Symbolic Link option.

If I manually select Pause Syncing from Dropbox system tray icon and then Resume syncing = it uploads the changes to the server.

I know I can move all my files inside Dropbox folder and create the junctions/symlinks at their original locations but I want to do it the other way around.

Also what is the difference between choosing the Junction and Symbolic Link Option in regards to a folder?

Thank you.

share|improve this question

migrated from webapps.stackexchange.com Oct 17 '13 at 12:59

This question came from our site for power users of web applications.

    
You may want to add some information on which operating system you are using. It is usually no problem on linux (even with symbolic links even pointing to a NTFS partition). It can however fail under some circumstances, for example I could not use it for syncing a folder in the AFS. –  Tim Oct 17 '13 at 13:06
    
Windows 7 Professional x64 on a NTFS Partition. Dropbox is installed on D:/Dropbox as opposed to its default installation folder in C:/ –  user2247336 Oct 17 '13 at 14:04

2 Answers 2

According to DropBox (https://www.dropbox.com/help/145/en)

Junction points and aliases

Dropbox will follow Windows junction points (Windows Vista or later) and sync the files or folders they link to. However, any changes to those files or folders made from the Windows operating system will not sync again until the Dropbox desktop application is restarted. To get around this, move the original folder to your Dropbox and add a junction point from its previous location to link to its new location in the Dropbox folder.

share|improve this answer

For a more advanced but better solution you can combine a rsync powered cygwin installation with a init batch script calling a cygwin shell script that would trigger - whenever scripted - a synchronization of the synchronized with the trusted 3rd party cloud storage folder with the contents lying in the watched folder.

(1.) Install cygwin following this link. Beware to select rsync in the list of packages to select. If you miss it you can safely rerun this installer whenever you want. Whenever you need another package in the future.

(2.) After you move around in cygwin getting a basic understanding of the environment, edit sync.sh whenever you want (you may later move it to a better location).

sync.sh contents:

#!/usr/bin/env bash
#   The synchronized folders.
WATCHED_FOLDER=/cygdrive/DRIVE_LETTER/PATH/TO/WATCHED/FOLDER
SYNCED_FOLDER=/cygdrive/DRIVE_LETTER/PATH/TO/SYNCED/FOLDER
#   Will run forever!
until false
do
  #   Do a single remote synchronization
  rsync -avn --delete WATCHED_FOLDER SYNCED_FOLDER
  #   Wait five minutes before resyncing.
  sleep 300
done

(3.) Do some testing with manual calls to sync.sh from cygwin. Watch the results. Change some folders and files and rerun. Watch again. Repeat.

(4.). Once you are satisfied with the results, turn -avn to -av to deactivate the dry running at your own risk. From this point changes will be run effectively with no Microsoft thrashbin support.

(5.) Go start->programs->start->[mouse right click]->open->new->file.

(6.) Name the file sync.bat or something.

(7.) Edit sync.bat and Cygwin's ~/.bashrc:

sync.bat contents:

rem   call the synchronization neverending script.
DRIVE_LETTER:\PATH\TO\CYGWIN\Cygwin.bat

~/.bashrc contents (this is the hard thing to do, because you need to edit it with vi from Cygwin, but you can most probably work this around by editing from Microsoft the file DRIVE_LETTER:\PATH\TO\CYGWIN\home\YOUR_USER_NAME.bashrc:

[...]
/cygdrive/DRIVE_LETTER/PATH/TO/sync.sh
[...]

That is a line that would call the infinite syncing loop. That is not the truly way of doing this kind of thing, but should be just OK for now.

(8.) Reboot

(9.) Check with taskmgr.exe or the Microsoft Task Manager that there is a bash.exe running. If you did not start cygwin yet, that should be the process doing the synchronization.

(10.) As optional future steps you may want to daemonize the process in any way. There may be many possibilities here.

This may be a hard walkthrough but there are a lot of community support in the Internet for all the stages.

Many other ways of doing may exist. For example you can autostart a GNU/Linux virtual machine that would do all of this without Cygwin. This would need you to share the watched and synced folders over the local network, better a private network between your host and the virtual machine only, and then mounting the folders from GNU/Linux using the cifs-utils, samba and smbclient packages. Many of the shown stages will apply the same to this other methodology of giving UNIX shell capabilities to your Microsoft host.

share|improve this answer

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.