Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I sometimes connect my Ubuntu laptop to my phone's 3G connection via tethering. When connected to that network I don't want Dropbox to synchronize as I have a limited data plan. I do want it synchronize when connected to my work or home Wifi.

I am looking for a clean yet easy solution in linux and more specifically Ubuntu. A more sophisticated solution that would actually place caps on the bandwidth for Dropbox when connected to certain wifi ESSIDs is also desirable.

share|improve this question
Here's a possible start. Dropbox uses port 443 (SSL). You won't want to block this port. So blocking the destination is an option. Here are the destination IP's What you want to do is create a script that when SSID = X, or when my public IP = aaa.bbb.ccc.ddd, block the following IP's. At least that's the idea I have for the moment. – Everett Aug 8 '12 at 3:52
I don't want to use static IP addresses. I was thinking more about a solution that would recognize the Dropbox daemon instead of the target of the communication. – smichak Aug 8 '12 at 4:00
You're not using static IP's, you are blocking the connection to DropBoxes IP's. It's the only way that you would be able to throttle traffic FYI (throttle instead of block). However, it sounds like you want a script that says when SSID = X, kill Dropbox Daemon. – Everett Aug 8 '12 at 4:03
up vote 9 down vote accepted

Instead of blocking dropbox, you could simply stop it when you are connected to the network in question (you don't need dropbox running to access locally synchronised files)

For example, placing the following in /etc/network/if-up.d/ will make it run after a network connection is established:

ifconfig -a | grep -q "192\.168\.0\." && killall dropboxd

This will kill (gracefully) the dropbox daemon when you connect to a network that give you an ip address in the 192.168.0.* range. If you can determine something that will identify your 3G network after connecting, then you can simply stop dropbox when you connect. You could extend this script to start dropbox when connecting to other networks.

share|improve this answer
Good going Paul! +1 – Everett Aug 8 '12 at 4:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .