The crontab is a list of commands that you want to run on a regular schedule, and also the name of the command used to manage that list.
crontab stands for “cron table,” because it uses the job scheduler cron to execute tasks;cron itself is named after “chronos,” the Greek word for time.
cron is the system process which will automatically perform tasks for you according to a set schedule. The schedule is called the crontab, which is also the name of the program used to edit that schedule.
We will be using root’s crontab, because edits to the system cronjob can get wiped out with system updates.
Check to see if root already has a crontab by issuing this command:
sudo crontab -l
If a crontab is present, you should pipe it into a file to back it up:
sudo sh -c 'crontab -l > crontab.bad'
Afterwards, we can edit the crontab by typing:
sudo crontab -e
If this is your first time running crontab, it will ask you which editor you wish to use. If you don’t have a preference for another editor, nano is typically a safe choice.
Afterwards, you will be taken to a file where we can automate tripwire. Since we will be running tripwire daily, we only need to decide what time we want it to run. Typically, services are run in non-peak times to not disrupt busy hours.
The format we need to use is
min hour * * * command. The command that we want to use is the same one we used to mail our report before. We don’t need to use sudo since this is going to be run as root.