Huu Phan | Blog Linux operating system | Linux operating system -Blog Huu Phan | www.huuphan.com
huuphan.com. Powered by Blogger.

How to running cron job every 5 minutes,seconds,hours,days

How to running cron job every 5 minutes,seconds,hours,days

How to running cron job every 5 minutes,seconds,hours,days. How to running a script a specific interval using cronjob in linux. 

To execute a cronjob every 5 minutes
*/5 * * * * /home/huupv/script.sh
To execute a cronjob every 5 hours
0 */5 * * * /home/huupv/script.sh
How to running a job every 5 seconds

$ cat every-5-seconds.sh
#!/bin/bash
while true
do
 /home/huupv/script.sh
 sleep 5
done






$ nohup ./every-5-seconds.sh &
To execute a cronjob every 5th weekday
0 0 * * 5 /home/huupv/script.sh
or
0 0 * * Fri /home/huupv/script.sh

0=Sun
1=Mon
2=Tue
3=Wed
4=Thu
5=Fri
6=Sat

post new :

Huu Phan | Blog Linux operating system | Huu Phan ~ Zimbra Mail Server,linux,bash script,centos,linux command | www.huuphan.com