cron or crond is daemon to execute scheduled commands (Vixie Cron) on a Linux or Unix-like systems. Usually, it is started automatically from /etc/init.d or systemd on entering multi-user runlevels. [donotprint]
Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | Yes |
Requirements | None |
Time | 1m |
RHEL/CentOS v4.x/5.x/6.x and Fedora Linux (older version) Verify Cron Service
You can simply use any one of the following command to see if crond is running or not, enter:
# pgrep crond
OR
# service crond status
Sample outputs:
crond (pid 4370) is running...
If it is not running type the following two command to start crond:
# chkconfig crond on
# service crond start
Verify cron is running by viewing log file, enter:
# tail -f /var/log/cron
A note about CentOS/RHEL v7.x+ and latest version of Fedora Linux
You need to use the following command to find out if the crond is running or not:
$ systemctl status crond.service
Sample outputs:
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled)
Active: active (running) since Tue 2015-05-19 14:53:32 EDT; 3min 7s ago
Main PID: 1292 (crond)
CGroup: /system.slice/crond.service
└─1292 /usr/sbin/crond -n
If not running configure the crond service to start automatically on boot:
$ sudo systemctl enable crond.service
$ sudo systemctl start crond.service
A note about Debian / Ubuntu Linux (older version) Cron service
On a Debian and Ubuntu Linux cron logs its action logged to the syslog facility i.e. use /var/log/messages file:
# tail -f /var/log/messages
Find out if cron daemon is running or not, enter:
# pgrep cron
If not running start it, enter:
# update-rc.d cron defaults
# /etc/init.d/cron start
A note about Debian Linux v8.x+ and latest version of Ubuntu Linux
The syntax is as follows to check if the cron service is running or not:
# systemctl status cron
Sample outputs:
● cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled)
Active: active (running) since Tue 2015-05-19 11:49:32 IST; 12h ago
Docs: man:cron(8)
Main PID: 1053 (cron)
CGroup: /system.slice/cron.service
├─1053 /usr/sbin/cron -f
└─3020 /usr/bin/atop -a -w /var/log/atop/atop_20150520 600
If not running configure the crond service to start automatically on boot:
$ sudo systemctl enable cron.service
$ sudo systemctl start cron.service
See Debian / Linux service management for more information.
- What is cron on a Linux or Unix-like systems?
- How To Add Jobs To cron Under Linux or UNIX?
- Verify crond Daemon And Cronjobs Are Running
- Start Restart and Stop The Cron or Crond Service
- List / Display All Cron Jobs
- Linux / UNIX Crontab File Location
- Change Crontab Email Settings ( MAILTO )
- Disable The Mail Alert By Crontab Command On a Linux or Unix-like Systems
- At What Time Cron Entries In cron.daily, cron.weekly, cron.monthly Run?
- Execute Cron Job After System Reboot
- Setup and Run PHP Script As A Cron Job
- Run crontab job every minute on a Linux or Unix-like system
- Running crontab (cron jobs) Every 10 Minutes
- Cron Job Script Execution on the Last Day of a Month
- Execute / Run crontab (cron jobs) every 1 minute
- Ubuntu create cron.log file
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 5 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
use ‘jobs’ command
thank you. your post saved my ass :D
Screw your ass………
this solution didn’t helped me.
thank you.
This is NOT WORKING