How To Setup Every Six Hour Cronjob Script
Now I want to share how to setup every six hour cronjob script on your linux server like ubuntu. Mainly you can all time check your script from crojob official website. So you have proper guideline from here.
Step #01: Create one script file for your command.
[[email protected] ~]# vi /home/script.sh
Insert your command into script.sh file. This command is for create one text file as example to you.
#!/bin/bash
touch test.txt
Then save if using press Esc. write :wq press Enter.
Step #02: Open server cron file using below command.
[[email protected] ~]# crontab -e
If you open this file first time so you can select 1, 2 or 3 for via open editor like nano, vim or vi. Then insert below conjob script for every six hour run this.
0 */6 * * * /home/script.sh
Then save and see result after six hour.
You can see for more result using this so you can see like below.
“At minute 0 past every 6th hour.” at 2020-05-10 12:00:00 then at 2020-05-10 18:00:00 then at 2020-05-11 00:00:00 then at 2020-05-11 06:00:00 then at 2020-05-11 12:00:00
Now enjoy 🙂