问题
I currently have my Dropbox saved on an external drive.
I'm trying to figure out if at least one of theses two things is possible when I do not have my external drive with me:
Can I create some kind of 'switch' so that when my external drive disconnects, the symbolic link automatically become a folder which I can still store my info in like usual, and next time I connect my external drive it will become a symbolic link again and upload the files that I stored while the drive was disconnected?
Or could I at least have the symbolic link point to a local folder when the drive is disconnected and then point back to the Dropbox folder when the drive is connected while still having the local folder auto-sync to the Dropbox folder?
Thanks!
回答1:
It should be doable to write a(n eg. bash) script to create and delete the symlink and do the copying (probably via a temp directory).
I don't know how to handle the triggering, though.
Brainstorming a bit, you can have a symlink in your dropbox folder that points to some other folder; I do that all the time in order to preserve my organizational structure at home but still have a subset available from elsewhere.
BUT symlinks only work within a single filesystem. I'm not positive about hardlinks.
Is your external drive formatted with HFS+? That could make a difference too.
回答2:
I don't fully understand your situation but if you want flexibility with creating symlinks to external drives that may be connected at one point and disconnected at other times, it seems like dropbox is not a good option for that. Prepare for file deletion, as I learned :)
I am finding that Google Drive with this Insync app for Linux is achieving the job. We'll see if it continues to.
EDIT: Dropbox Support told me that indeed dropbox does not support symlinks to external drives which get disconnected. It results in deleting everything the symlink pointed to. Here's their response:
Hi there,
I'm Tyler. Thanks for contacting Dropbox Support!
Currently, the Dropbox desktop application does not support such a feature on any operating system.
Dropbox can be used with an external hard drive as long as you can ensure the drive is always connected to your computer while Dropbox is running. If the drive is ever disconnected from the computer while Dropbox is running there is a small chance that the Dropbox software will start deleting files before realizing that the entire drive has been removed. Also, for Dropbox to work best you should make sure that the drive is formatted as NTFS (Windows), HFS (Mac OS X) or a file system that supports extended attributes (Linux).
来源:https://stackoverflow.com/questions/18197877/automatically-switching-between-symbolic-links-and-folders