cron 每两周执行_如何每两周/月/天执行一次cron作业

cron 每两周执行

We may want to run some jobs for every two weeks/months/days… under some situation such as backing up for every other week. In addition, we may add more complex rules for running jobs, e.g. run a command when the load of the server is higher than a certain level. With the help of the shell programming language we can easily achieve this goal.

在某些情况下,例如每隔一周备份一次,我们可能希望每两周/月/天运行一些工作。 此外,我们可能会为运行作业添加更复杂的规则,例如,当服务器的负载高于特定水平时运行命令。 借助Shell 编程语言,我们可以轻松实现此目标。

crontab的基础 (Basics of the crontab)

Crontab file controls how and what to run by cron. The crontab line has a format as follows:

Crontab文件控制cron的运行方式和运行方式。 crontab行的格式如下:

.---------------- minute (0-59)
|  .------------- hour (0-23)
|  |  .---------- day of month (1-31)
|  |  |  .------- month (1-12) OR jan,feb,mar,apr ...
|  |  |  |  .---- day of week (0-6) (Sunday=0 or 7) OR sun,mon,tue ...
|  |  |  |  |
*  *  *  *  *  command to be executed

To add a cron job for your current user, run

要为当前用户添加cron作业࿰

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值