minute hour day_of_month month day_of_week $USER COMMAND
man 5 cron
for explanation/var/spool/cron
directory where cron checks for user jobs
Handy way of having a reference.
$ cat /etc/crontab >> /var/spool/cron/$USER
*/15 12 * * * logger "doing something"
this would run it every 15 minutes starting from 12:00 o'clock (24 hour format) till 13:00.
12:00
, 12:15
, 12:30
, 12:45
15 12 15 * Fri logger "doing something"
runs the command on the 15th of every month, and every Friday at 12:15
note: When the Day of month and Day of week fields are both other than *, the command is executed when either of these two fields are satisfied
-
if
/etc/cron.deny
exists it will implicity allow users not listed to run/etc/crontab -e
and will explicity disallow users listed. -
if
cron.allow
exists it will only allow user listed in the file and explicity disallow user not listed from running crontab -e -
if neither file exist only the root user is allowed to run crontab -e
. | cron.deny exists | cron.deny does not exist |
---|---|---|
cron.allow exist | only user listed in cron.allow are allowed | only user listed in cron.allow are allowed |
cron.allow does not exist | user listed in cron.deny aren't allowed | only root user can use crontab -e |
-
We can have a file or partition as a swap space.
-
The steps for addin a swap space is
- prepare a file or partition
- run
mkswap
on the file or partition - run
swapon
on the file or partition - add the the file or partition to
/etc/fstab
(optional)
-
swapon -s
orfree -h
are some of the commands to view swap space -
dd
orfallocate
can be used to create a swap file. (dd command is recommend,trust me )
Tonight's Presenters
- Bismarck Mosioma on _Schedule tasks to run at a set date and time _
- Muse Sisay on Configure and manage swap space and Setup user and group disk quotas for filesystems
Reference
- Thingy to check your crontab before adding them to corn https://crontab.guru/