nobleit
asked on
cronjob
I have a script my_backup.sh
I want to generate in every 12 hrs
how we will create a crontab file first
* * * * * root /home/root/scripts/my_back up.sh
I want to generate in every 12 hrs
how we will create a crontab file first
* * * * * root /home/root/scripts/my_back
0,30 * * * * root /home/root/scripts/my_back up.sh
use the command:
crontab -e
then enter:
0 0,12 * * * root /home/root/scripts/my_back up.sh
crontab -e
then enter:
0 0,12 * * * root /home/root/scripts/my_back
Hmm, I misread and posted a crontab entry that will run twice each hour...
@savone, what is the root for?
@savone, what is the root for?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
what will be the difference if I want to run in every half an hour..
Here's a reference of a crontab entry:
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
Run the cron job every hour and half (or every 90 minutes):
*/90 * * * * /home/root/scripts/my_back up.sh
*/90 * * * * /home/root/scripts/my_back