💾 Archived View for squid.flounder.online › cheatsheet › cron.gmi captured on 2024-03-21 at 15:14:25. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-04)

-=-=-=-=-=-=-

Return to Squid's World

cron

To edit the cron jobs, do:

crontab -e

Syntax

┬ ┬ ┬ ┬ ┬

│ │ │ │ │

│ │ │ │ │

│ │ │ │ └───── day of week (0 - 7) (Sunday to Sunday, 0 and 7 are Sunday)

│ │ │ └────────── month (1 - 12)

│ │ └─────────────── day of the month (1 - 31)

│ └──────────────────── hour (0 - 23)

└───────────────────────── min (0 - 59)

example:

0 3 * * 0 /home/mitch/bin/ctrl-c-backup.py

0 3 means 3 AM.(minute 0, hour 3)

The first * means any day of the month.

The second * means any month.

The 0 at the end means Sunday.

You can choose any value from 0 to 7 where both 0 and 7 will represent Sunday.

NOTE: cron does not use the PATH variable, so make sure to do

chmod +x on the script, and add a crunch bang #!/usr/bin/python to tell it where the interpreter is

-----------------------------------------------------------------

Listing Cron Jobs

crontab -l

Return to Squid's World