Can we change the day and time of a schedule task which is already created
I have already created a schedule task which runs weekly on some day(wed). I want to change the day and the time of the same task.
Is it P开发者_如何学Cossible?
If it is not possible, then delte the current scehdule task first and recreate a new one is the solution?
To get a list of the the current cron jobs scheduled for the user your logged in as, type the following at your shell prompt (assuming it's, $):
crontab -l
You'll get a crontab that looks like this:
10 3 * * * /home/user/scripts/backup.sh
15 3 * * 0 /home/user/scripts/alarm.sh
This, for example, shows that the backup.sh script will run every day at 3:10 am. The alarm.sh script will run at 3:15 am on Sunday.
The format of crontab is as follows:
.---------------- Minute (0 - 59)
| .------------- Hour (0 - 23)
| | .---------- Day of the Month (1 - 31)
| | | .------- Month (1 - 12) or jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec
| | | | .---- Day of the Week (0 - 6) or sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * /command/to/run
You can edit the crontab schedule by passing the -e (edit) switch:
$ crontab -e
This will drop you into the default editor and should allow you to edit the crontab as if it were any other text file. When you are done, save your changes and exit the editor. Running crontab -l again should show you your updated changes.
If you are speaking of an at
job, then you need to erase it using atrm
.
If you are speaking of a cron
job, then you can change it as much as you want before the job is executed. It includes both its scheduling and its content.
精彩评论