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 stopThis 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
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 . There is also a nice startup init.d script there, you might consider following that guide.
2