Cron jobs in Ubuntu?

Soldato
Joined
4 Jan 2004
Posts
20,802
Location
¯\_(ツ)_/¯
How on earth do I do this? When I try it in terminal, I get this error:

cron: can't lock /var/run/crond.pid, otherpid may be 4562: Resource temporarily unavailable

I've also made sure anacron and the other scheduler thing is running in the services window.

What I need to do is run some shellscript once a day...
 
How are you trying to add a cron job? It sounds like you're typing cron at the command line which will run the scheduling daemon, however you've already got it running - hence the error message.

You want to do sudo crontab -e (edit the root/system wide cron schedule) and then add your script path and timing as normal e.g.
Code:
30 9 * * * /path/to/script.sh
will run your script at 0930 everyday. I'd check the script has executable permissions and absolute pathnames in it as running via cron can do some strange things :).
 
Doh, I was just running "cron" :o

It's been a while so I'm a little rusty, but I'll make sure my script is chmodded, and hopefully it should work. Thanks!
 
Back
Top Bottom