Ubuntu – Is it possible to exclude a file or folder from being synced, while it is in a directory that was synced


I synced a folder called "travel". I want to exclude a file in this folder from being synced. Is this possible? Do the other big syncers, like dropbox and mozy, have this feature?

Best Answer

Ubuntu One does not currently support this; a workaround would be to move the folder out from the folder it is currently in (and point a symlink at it from the synced folder if necessary), or rename it to something unique and add that name to the 'ignore' pattern list (this second way is rather tricky; please read the note below).

Here's how to do the first: assuming travel is in a directory called misc, and that the subdirectory of travel you don't want synced is called huge, open a terminal (Applications » Accessories » Terminal) , and type:

 cd misc
 mv travel/huge .travel_huge
 ln -s ../.travel_huge tavel/huge

note that .travel_huge is a hidden directory, so you wouldn't normally see it in the nauitlus and file pickers.

dangerous bend

Here's how you do the second, asuming the unique name you chose for huge is huge-pics-of-acorn-trees-february-2011: first, edit ~/.config/ubuntuone/syncdaemon.conf (you can use Applications » Accessories » Text Editor) and add the following to the __main__ section (if the file doesn't exist, prepend the following by a line containing just [__main__]):

ignore = \A#.*\Z

or you could simply rename the folder to something already covered by the current ignore list, such as huge.tmp or huge.pyc, but I doubt you'll like that.

Please do note, however, that the second method described is rather fragile: make sure you've updated the configuration file and restarted syncdaemon (with u1sdtool -q; u1sdtool -c) before creating the toplevel directory. If the directory already exists, do not move it to the ignored name with the syncdaemon running; rather, stop syncdaemon, rename the folder, edit the ignore list, and start syncdaemon. Alternatively move the folder out of the synced hierarchy, and rename it before moving it back in. Otherwise it might not work as you'd expect it to, if at all.

I understand dropbox has the feature (I've seen a video explaining how to use it), but I haven't checked and it might only be in a beta or something like that.