7

I have setup a service on my Ubuntu 10.04.4 LTS server, which works when started and stopped manually using sudo service <service> start etc.

However I would like to have the service (dropbox btw.) only running for a few hours each day, as the service uses a lot of memory.

I have added the following to my cron using crontab -e, but it doesn't work as expected:

1 5 * * * /etc/init.d/dropbox start
1 6 * * * /etc/init.d/dropbox stop

This returns the following message start-stop-daemon: not found. Am I doing it wrong and if so how do you start / stop a service at a specific time?

1 Answer 1

7

Dropbox is not started at boot time, there is no init.d script to do it. The daemon is started at login for each user and the binaty is located in ~/.dropbox-dist/dropbox.

To start up the daemon you need to use the command

start-stop-daemon -b -o -c user -S -u user -x ~/.dropbox-dist/dropbox

and to stop it you need to use

start-stop-daemon -o -c user -K -u user -x ~/.dropbox-dist/dropbox

Where user is your username.

Source for this information is at http://ubuntuserverguide.com/2012/06/how-to-install-and-configure-dropbox-on-ubuntu-server-12-04.html. There is also a nice startup init.d script there, you might consider following that guide.

2
  • I was already using the init.d script from your link. However I had to add the following line above line 3 (DROPBOX_USERS line): PATH=${PATH}:/sbin to make the cron daemon find the start-stop-daemon.
    – svandragt
    Jul 24, 2012 at 9:07
  • Perfect, you can also add that an answer and accept it as the correct one since you found what was the issue with the scrip. Jul 24, 2012 at 9:30

You must log in to answer this question.

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