Every cron job uses five fields. Here is an explanation of what each field does in this cron, which runs “every 1 hour at 30 minutes past the hour“: Field 1: (30) indicates that the task will be run atminute30. Field 2: (*) indicates that the task will be run everyhour. Fiel...
# 每十分钟执行任务schedule.every(10).minutes.do(job) # 每个小时执行任务schedule.every().hour.do(job) # 每天的10:30执行任务schedule.every().day.at("10:30").do(job) # 每个月执行任务schedule.every().monday.do(job) # 每个星期三的13:15分执行任务schedule.every().wednesday.at("13:15")...
# (put your own initials here)echo the date to the console every # 15minutes between 6pm and 6am 0,15,30,45 18-06 * * * /bin/echo 'date' > /dev/console 保存并退出。确信前面5个域用空格分隔。 在上面的例子中,系统将每隔1 5分钟向控制台输出一次当前时间。如果系统崩溃或挂起,从最后所...
hour(int or str) 时(0-23) minute(int or str) 分(0-59) second(int or str) 秒(0-59) start_date(datetime or str) 最早开始日期(含) end_date(datetime or str) 最晚结束日期(含) timezone(datetime.tzinfo or str) 指定时区 表达式类型 表达式参数类型描述 * 所有 通配符。例:minutes=*即每...
#(put your own initials here)echo the date to the console every #15minutes between 6pm and 6am 0,15,30,45 18-06 * * * /bin/echo ‘date’ > /dev/console 保存并退出。确信前面5个域用空格分隔。 在 上面的例子中,系统将每隔1 5分钟向控制台输出一次当前时间。如果系统崩溃或挂起,从最后所...
minute hour day month week command 其中: minute: 表示分钟,可以是从0到59之间的任何整数。 hour:表示小时,可以是从0到23之间的任何整数。 day:表示日期,可以是从1到31之间的任何整数。 month:表示月份,可以是从1到12之间的任何整数。 week:表示星期几,可以是从0到7之间的任何整数,这里的0或7代表星期日。
# (put your own initials here)echo the date to the console every # 15minutes between 6pm and 6am 0,15,30,45 18-06 * * * /bin/echo 'date' /dev/console 保存并退出。确信前面5个域用空格分隔。 在上面的例子中,系统将每隔1 5分钟向控制台输出一次当前时间。如果系统...
Every 5 Minutes Every 10 Minutes Every 15 Minutes Every 30 Minutes Every 45 Minutes Custom Hours Template Every Hour Even Hours Odd Hours Every 4 Hours Every 6 Hours Every 8 Hours Every 12 Hours Custom Days Template Every Day Even Days Odd Days Every 5 Days Every 10 Days Every 15 ...
# run custom script the first day of every month at 4:10AM 10 4 1 * * /root/scripts/backup.sh 1. 2. 3. 4. 5. 例 37-1. crontab 的例子 根用户以外的用户可以使用 crontab 工具来配置 cron 任务。所有用户定义的 crontab 都被保存在 /var/spool/cron 目录中,并使用创建它们的用户...