Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 992 Bytes

index.md

File metadata and controls

35 lines (24 loc) · 992 Bytes

Crontab & Cronjobs

Crontab is a scheduling service that can automate certain tasks for you like creating backups or in our case annoy us every 10 minutes with a shitty popup!

Adding a cronjob

Simply run crontab -e as root and you will be see something like this: cron

I highly recommend this site!

The way it works is that you got timers for every minute, hour, day, month and year which you can specify to a specific value. Now the subject requires us to run the script every 10 minutes. We can do so like this:

#Runs every 10th minute of the hour
*/10 * * * * bash /etc/monitoring.sh

Starting and stopping the service

One requirement is to start and stop cron without touching anything, except the command line.

Start

#Starts the service...
/etc/init.d/cron start

Stop

#Stops the service...
/etc/init.d/cron stop

This is actually it, yeah theres not much to it.