SHIFT

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


Sidebar

Recently Changed Pages:

View All Pages


View All Tags


LinkedIn




WIKI Disclaimer: As with most other things on the Internet, the content on this wiki is not supported. It was contributed by me and is published “as is”. It has worked for me, and might work for you.
Also note that any view or statement expressed anywhere on this site are strictly mine and not the opinions or views of my employer.


Pages with comments

View All Comments

cron

Cron

Scheduled tasks:

minutes hour dayofmonth month dayofweek user command

* * * * * root everyminute
*/5 * * * * root every5minutes (only works on linux, aix needs 0,5,10,15,20,25,30,35,40,45,50,55)
1 * * * * root everyhour
1 1 * * * root everyday
1 1 * * 0 root everyweek (0=Sunday)
1 1 1 * * root everymonth

In the personal crontab files you need to leave the user out:

* * * * * everyminute

Crontab

To edit a user's crontab enter the command:

crontab -e

To view your crontab file enter the command:

crontab -l

To remove all your crontab jobs enter the command:

crontab -r 

Cron Files

Crontabs:

/var/spool/cron

Cron itself:

/var/adm/cron

Cron logfile on solaris:

/var/cron/log

Cron logfile on solaris:

/var/log/cron

Cron Security

CRON users: To allow root only:

  • remove /var/adm/cron/cron.deny & /var/adm/cron/cron.allow

To allow anyone to use it:

  • touch cron.deny if it does not exist.

To explicitly allow a user and no one else except root:

  • touch cron.allow & put user ID in it.

To explicitly deny a user:

  • touch cron.deny & put user ID in it.
Note: On Solaris 10 these files are located at /etc/cron.d/


Note: On Red Hat EL 5.5 these files are located at /etc

Cron Editor

Cron uses the editor you want. To make sure it is the one you want use the EDITOR variable:

export EDITOR=vi
You could leave a comment if you were logged in.
cron.txt · Last modified: 2021/09/24 00:24 (external edit)