5

I've been trying to suss out how to add a job using crontab from this video:

https://www.youtube.com/watch?v=vrPGRE6FV9g

Easy enough and understandable but I can't find the crontab in etc? Acutally a few videos seems to mention the crontab too. It seems like all the videos are old and not for Ubuntu 16.04.

So where is it, if there is one at all? If there isn't one, anyone have a tutorial for 16.04 I can follow?

Thanks!

EDIT: Sorry guys, I found it. I was looking for a physical folder in etc/ but it is not a folder!!! Thank you everyone.

  • 1
    Use and crontab -e to setup scheduled tasks and crontab -l to show what you have setup. – troylatroy Sep 16 '16 at 16:42
  • I find /etc/contact the better choice. 1 place for all cronjobs. – Rinzwind Sep 16 '16 at 16:52
7
sudo nano /etc/crontab 

... will let you add cronjobs. It has a bit off a comment in there to explain the basics. It also already contains methods for daily, weekly, and monthly jobs.


edit: here is the file:

 more /etc/crontab 
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --repor
t /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --repor
t /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --repor
t /etc/cron.monthly )
#

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.