Wednesday, December 8, 2010
11:05 PM

Fixing Dropbox startup issues in Ubuntu

I am a big Dropbox fan, no use hiding it. I use several machines on a daily basis, including Windows XP and 7, as well as a plethora of Linux distros. Dropbox is a solid thread that links them all, helping me make sense of the whole thing while keeping all my data safe and centralised. Dropbox has truly influenced the way I work these days, making my life easier in many ways.

Changing files from my Dropbox folders is something that happens many times a day, so it is critical for me to keep its daemon running at all times while I work. Because of that, I find it annoying when randomly, for no apparent reason, it does not properly start in Ubuntu/Linux Mint. Basically, Dropbox remains in a "Connecting..." status forever, forcing me to manually stop and start the service.

I decided to put together a short and simple script that fixes this problem, checking Dropbox status after a number of seconds and then restarting the service automatically if necessary. I have configured the script to sleep for 30 seconds before running a status check, but you may change that figure to suit your machine/network setup.

HOW DOES IT WORK?

In case you don't know, Dropbox for Linux provides a simple command line interface. Dropbox status may be checked upon at any time using the following command:

dropbox status

From what I have gathered, there are four possible states, namely:
  • Idle: Dropbox is running fine, in standby status until any potential synchronization is required.
  • Downloading file list: Dropbox just connected to the server and is gathering information.
  • Connecting...: Dropbox is trying to connect to the server. This is usually the status it is at when the problem appears. Instead of going into Idle status, Dropbox remains in Connecting status.
  • Dropbox isn't running!: Pretty self explanatory.

My script loads on startup, just like the Dropbox daemon does. As I mentioned already, the script will allow 30 seconds before checking Dropbox status. If the check returns status Idle or Downloading file list, the script will do nothing and let Dropbox do its thing. Any other status will display some GUI messages, then restart Dropbox.

I added a couple screenshots below to show how the script works.



After 30 seconds, the script checked and found that Dropbox was not running. It then displayed a simple message informing the user that the Dropbox daemon would be restarted. Once the user clicks OK, the restart takes place and a confirmation message appears.



WANNA USE IT?

If you have experienced the same strange random Dropbox behavior yourself, you may find this script interesting and want to use it. If so, it is real simple, just follow these easy steps:

1.- Download the script from HERE.
2.- Save it as CheckDropbox.sh and then grant it execution privileges.
3.- Finally, configure it to run on startup. Go to Main menu > System > Preferences > Startup Applications and create a new entry pointing to the script.
4.- Exit your current session and login again, or simply reboot for the script to take effect.

I hope this little script helps you too in getting rid of that little Dropbox connection annoyance.

Thanks for reading!

0 comments:

Post a Comment