我们可以更改已创建的计划任务的日期和时间吗
我已经创建了一个计划任务,每周在某一天(星期三)运行。 我想更改同一任务的日期和时间。
是否可以?
如果不可能,那么先删除当前的 scehdule 任务并重新创建一个新的是解决方案吗?
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 Possible?
If it is not possible, then delte the current scehdule task first and recreate a new one is the solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要获取为您登录的用户安排的当前 cron 作业的列表,请在 shell 提示符下键入以下内容(假设是 $):
您将得到一个如下所示的 crontab :
例如,这显示 backup.sh 脚本将在每天凌晨 3:10 运行。 Alarm.sh 脚本将在周日凌晨 3:15 运行。
crontab 的格式如下:
您可以通过传递 -e(编辑)开关来编辑 crontab 计划:
这会将您带入默认编辑器,并且应该允许您像编辑任何其他文本文件一样编辑 crontab。完成后,保存更改并退出编辑器。再次运行 crontab -l 应该会显示更新后的更改。
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, $):
You'll get a crontab that looks like this:
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:
You can edit the crontab schedule by passing the -e (edit) switch:
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.
如果您谈论的是
at
作业,那么您需要使用atrm
删除它。如果您谈论的是
cron
作业,那么您可以在执行作业之前随意更改它。它包括其日程安排和内容。If you are speaking of an
at
job, then you need to erase it usingatrm
.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.