Cron: Difference between revisions

From Cheaha
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:


=== Cron Expression Table ===
=== Cron Expression Table ===
Cron actions are driven by a crontab file, also known as a cron table. The user's crontab file is a configuration file that specifies specific shell commands to run at a given schedule.  
Cron actions are driven by a crontab file, also known as a "cron table". The user's crontab file is a configuration file that specifies shell commands to run at a given schedule.  


Each line of a crontab file represents a job, and looks like this:
Each line of a crontab file represents a job, and looks like this:
 
<pre>
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │                                  7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * <command to execute>
</pre>
=== Crontab Options ===
=== Crontab Options ===


Line 17: Line 27:


== Examples ==
== Examples ==
==== Using Cron and initiating an sbatch To Run A Bash Script ====

Revision as of 22:41, 9 March 2021

Cron

What Is Cron?

Cron is a unix time based job scheduler tool.

Overview

Crontab Syntax

Cron Expression Table

Cron actions are driven by a crontab file, also known as a "cron table". The user's crontab file is a configuration file that specifies shell commands to run at a given schedule.

Each line of a crontab file represents a job, and looks like this:

# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │                                   7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * <command to execute>

Crontab Options

Setup

Examples

Using Cron and initiating an sbatch To Run A Bash Script