at命令:
at [option]…time
- -l atq 也可以查看計劃任務
- at的作業有隊列,用單個英文字母表示,默認都使用a隊列
- -f /somefile 可以指定文件 讀取作業任務
- -d 刪除指定的作業,相當于atrm
- -c 查看指定作業的具體內容
- -q queue:指明隊列;查看任務
- time:hh:mm[yyyy-mm-dd]
- noon,midnight,teatime,tomorrow,now+#
crontab命令:
crontab [-u user] [-l] [-e] [-i]
- -e:編輯任務;
- -l:列出所有任務
- -r:移除所有任務;即刪除/var/spool/cron/USERNAME文件;
- -i:在使用-r選項移除所有任務時提示用戶確認;
- -u:user:root用戶可以為指定的用戶管理cron任務;
- # Example of job definition:
# .—————- 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,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed - ? ?10 3,5 * * 3 bash??/tmp/scrips/cron.sh
- cron.sh
- #!/bin/bash
# description:
# version:0.0.1
# author:yin wei <8378777618@qq.com>
# date:
date “+%F %T”
本文來自投稿,不代表Linux運維部落立場,如若轉載,請注明出處:http://www.www58058.com/100526
建議命令和理論區分一下,整理一下格式。