Linux: Run Cron Job Every Minute

This post will guide you how to run a cron job every minute under Centos/RHEL/Ubuntu Linux system. How do I run crontab job every minute in Linux system. I can use the Cron.hourly, cron.daily, cron.weekly, cron.monthly to run an anacron job, but no cron.minutly. so How to achieve it.

Run Cron Job Every Minute


If you want to run your cron job every minute in your Linux system, you just need to do the following steps:

#1 issue the following command to edit crontab configuration file, type:

#crontab -e

#2 adding the below line into the file

* * * * * /fio.sh

Note:

# Example of job definition:

# .---------------- minute (0 - 59)

# | .------------- 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

 

#3 save and close the file.

#4 Restart Cron Service

If you want to restart the Cron service in current Linux system, issue the following command:

#service crond restart

Or

#/etc/init.d/crond restart

For CentOS/RHEL 7.x or Debian/Ubuntu Linux

To restart the cron service, issue the following command:

#systemctl restart crond.service

 

 

 

You might also like:

Sidebar



back to top