-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCrontab.task
42 lines (33 loc) · 1.5 KB
/
Crontab.task
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#Crontab
Cronjobs are configured in crontab files. Do not edit these files directly. Use crontab -e instead. This runs all required actions to activate a cronjob after saving the edited crontab. The locations are as follows:
/var/spool/cron/username user specific
/etc/crontab system wide crontab
The format of the files is (user specific crontabs do not have the column user-name):
Example of job definition:
.---------------- minute (0 - 59 | */5 [every 5 minutes])
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12) OR jan,feb,mar,apr ...
| | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * user-name command to be executed
Command Description
rpm -q cronie Check if package is installed
systemctl status crond.service Check if service is running
crontab -l List current users crontab
crontab -e Edit current users crontab
crontab -e -u username Edit specific users crontab
crontab -r Remove current users crontab
Script folders
Scripts in one of the following directories will be executed at the intervall specified by the directory's name:
/etc/cron.hourly
/etc/cron.daily
/etc/cron.weekly
/etc/cron.monthly
Allow / Deny usage
Add user names one per line to the following files:
/etc/cron.allow Whitelist
/etc/cron.deny Blacklist
If none of the files exists, all users are allowed.
Logs and Results
Execution of cronjobs is logged in /var/log/cron. Results are sent to the users mail /var/spool/mail/username