How to exclude files (not folders) from dropbox sync?

I am trying to sync my Firefox profile folder using Dropbox, but there are several files that Firefox changes quite frequently

1. Folders: Cache, OfflineCache can be excluded
2. Files: urlclassifier3.sqlite, places.sqlite - these files are big and are changed anytime

OS: Windows 7

Does anyone know how to exclude files listed in #2 from Dropbox sync?

-

migrated from stackoverflow.comSep 4 '12 at 4:11

This question came from our site for professional and enthusiast programmers.

–  Alex Jan 9 '12 at 9:39
Bookmark Backup Firefox addon copies the bookmarks file to a directory of your choice every time you close Firefox. You can point it to your Dropbox folder. Another option is to use Windows Robocopy + taskschd to do the same thing. To copy places.sqlite every 60 minutes you can use something like this: robocopy C:\Users\Someone\AppData\Roaming\Mozilla\Firefox\Profiles\default C:\Users\Someone\dropbox\apps\firefox\ places.sqlite /MOT:60 – You can schedule it to start with windows so you will not have to rerun every boot. –  ramiwi Nov 10 '13 at 17:13
You may not need to worry about big files being synced. Dropbox does not sync the whole file only the portion that changed. Look at serverfault.com/questions/52861/…. In practice, I have seen this happen on a number of big files which are changed frequently. –  Ashutosh Jindal Jan 30 '14 at 17:46
Wouldn't it be better to use Firefox's built-in sync function, rather than causing potential problems by using dropbox? Also, do you really want to give all your browsing history to Condoleeza Rice? –  stib Jun 6 '14 at 6:47
@AshutoshJindal While the bandwidth isn't that great I get annoyed every time I edit a word document in a synched folder and the ~ file gets synched and then deleted. –  Loren Pechtel Apr 3 at 22:55

To exclude FILES, not folders, from Dropbox, there is a trick you can do:

1. Move the file somewhere else

2. Create a folder with the same name in place of the file

3. Go to Dropbox selective sync options and ignore the folder, this will also delete it

4. Move the file back in place

-
this is the way to go! –  duedl0r Jul 8 '14 at 9:03
Thanks for the workaround. Why doesn't dropbox allow this natively!? I'd love to be able to exclude files/folders based on regex, but maybe that's too geeky for such a commercial product. –  bradvido Aug 12 '14 at 13:06
I would rather have a .dropboxignore file :P –  Zequez Aug 13 '14 at 13:15
For those who may not be aware, you will need to set the selective sync setting on each device. At least that was my experience. Nice work-around though –  Brettski Oct 18 '14 at 16:22
Yeah, it certainly should be included. –  Loren Pechtel Apr 3 at 22:54

In Dropbox Settings, go to Advanced > Selective Sync. If you see an Advanced View or similar button, click it. Uncheck the cache folders and any other folders you find Firefox is changing frequently.

I did this with my Chrome installation and the above steps helped me shave off the syncing of huge caches, icons, etc.

As for any files you don't want synced but you find are inside folders that you do want synced, exit Firefox, move the file to another location, then create a symbolic or hard-link to it in the original location. When Firefox is run again, it will see the file as though it was never moved, but Dropbox will see the link and not sync the actual file.

Apparently Dropbox does sync symbolic links or hard links as though they are actual files.

But if you know for sure what files in a folder you want synced (that is, their names are fixed, not changing or random), you can do a reverse-syncing hack:

• In Selective Sync feature, exclude the entire folder containing both the files you don't want synced and those you do want synced.
• Create a new folder next to the excluded folder. This folder will be synced by Dropbox. You may name it suitably to indicate that it is a duplicate of the excluded folder.
• In the new folder, create hard links (or symbolic links) to the files in the original excluded folder that you do want to be synced.

Dropbox will sync these files as though they are residing in this new folder, eventhough they are actually in the original one. In addition, Dropbox will not sync files that you did not create links to.

-
Then I can only think of a reverse-hack. Exclude that entire folder, but create a duplicate folder, then hard-link (or symlink) all the files you do want to be synced in that folder. So that essentially, all the files you did not link to will not be synced because the original folder is now excluded. Of course this assumes the file names are fixed, not random. –  ADTC Nov 10 '13 at 19:28
Well, I can see how this is going to work for a small set of files, but I'm sure Firefox will create files during usage that could be needed. Somebody needs to test this, I guess. –  slhck Nov 10 '13 at 19:39
Yes, it will only work seamlessly with a known set of files. –  ADTC Nov 11 '13 at 3:28

You cant exclude files from dropbox sync , but you can delete them or change those files location.

Using DropBox for Firefox sync may result in conflict of profile, better use FireFox built in Sync tab under option or settings

-
Thanks. But the firefox built in sync can't handle the extensions part. –  Jun Jing Zhang Jan 9 '12 at 12:46
just see the updated firefox it has option to syn extension too.. voteup or accept if it helps you –  Kishore Jangid Jan 9 '12 at 13:35

On Linux, you can use the dropbox command line tool that comes with Dropbox:

$dropbox filestatus PV_2013.aux: up to date PV_2013.log: up to date PV_2013.pdf: up to date PV_2013.tex: up to date$ dropbox exclude add *.log *.aux
Excluded:
../ag_2013/pv_2013.aux
../ag_2013/pv_2013.log

\$ dropbox filestatus
PV_2013.pdf:                      up to date
PV_2013.tex:                      up to date

-

I'm not sure what OS you're using or how Firefox in particular would react to this but whenever I need to exclude files from Dropbox (which cannot simply be deleted or moved for whatever reason), I simply move the file outside of the Dropbox folder and then create a symlink in the old location pointing to the new one.