Jobs, cron, and crontab

Automation is an essential aspect of the Linux operating system. It is important for system administrators and also for penetration testers to automate many tasks to avoid wasting time in repeating them. As discussed in the previous chapter, penetration testing is a time-limited mission. So, good time management is an in-demand skill for every successful pentester. Linux gives users scheduling capabilities to run commands or scripts in a specific time, and in a repeatable manner. The cron utility is the key to achieve this. Cron gives you the ability to run a background job as a routine in a defined time. The following is a cron command format:

<Day of the week> <Month> <Day of the Month> <Hour> <Minutes> <Command> ...

Get Advanced Infrastructure Penetration Testing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.