使用Windows At Command计划作业和任务

Linux have the same command for same reasons to schedule commands and jobs for specified times and periods. Windows have the same command with similar usage too. Alternative to this command is schtasks command which will schedule future jobs too. We will look some usage examples of at command.

由于相同的原因,Linux具有相同的命令,可以在指定的时间和周期内调度命令和作业。 Windows也具有相同用法的相同命令。 schtasks命令可以替代此命令,该命令也将计划将来的作业。 我们将看一下at命令的一些用法示例。

帮帮我 (Help)

Help about at command can be listed with /? option.

关于at命令的帮助可以用/?列出/? 选项。

$ at /?
Help
Help
帮帮我

安排工作(Schedule Job)

Jobs can be scheduled easily. We will specify the time and command with its parameters. In this example 11:00:00PM is given as time and echo "hi" is given as command and parameter.

可以轻松安排工作。 我们将使用其参数指定时间和命令。 在此示例中,11 11:00:00PM被指定为时间,而echo "hi"被指定为命令和参数。

$ at 11:00:00PM echo "hi"
Schedule Job
Schedule Job
安排工作

安排定期工作(Schedule Recurrent Job)

We can create a a job which will run every given time or date period. In this example we create a job which will run defrag c: command every Sunday .

我们可以创建一个将在每个给定时间或日期周期运行的作业。 在此示例中,我们创建一个作业,该作业将在每个Sunday运行defrag c:命令。

$ at 10:00 /every:sunday defrag c:
Schedule Recurrent Job
Schedule Recurrent Job
安排定期工作

列出计划的工作(List Scheduled Jobs)

There will be a lot of all ready scheduled jobs. We can list those jobs. We may list these jobs to learn their id and delete them. We will use at command without any option to list existing jobs.

所有准备好的预定工作都会很多。 我们可以列出这些工作。 我们可能会列出这些作业以了解其ID并将其删除。 我们将使用at命令,而没有任何选择来列出现有作业。

$ at
List Scheduled Jobs
List Scheduled Jobs
列出计划的工作

删除预定作业(Delete Scheduled Jobs)

All ready created jobs can be deleted with /delete option and the id of the job. In this example we will delete job id 2 .

可以使用/delete选项和作业ID /delete所有已创建的作业。 在此示例中,我们将删除作业id 2。

$ at 2 /delete
LEARN MORE  How To Set Job With Different User In Crontab?
了解更多信息如何在Crontab中与其他用户一起设置作业?

翻译自: https://www.poftut.com/schedule-jobs-tasks-windows-command/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值