
| 代码: |
第1列分钟1~5 9 第2列小时1~2 3(0表示子夜) 第3列日1~3 1 第4列月1~1 2 第5列星期0~6(0表示星期天) 第6列要运行的命令 |
| 代码: |
分< >时< >日< >月< >星期< >要运行的命令 |
| 代码: |
30 21* * * /apps/bin/cleanup.sh |
| 代码: |
45 4 1,10,22 * * /apps/bin/backup.sh |
| 代码: |
10 1 * * 6,0 /bin/find -name "core" -exec rm {} \; |
| 代码: |
0,30 18-23 * * * /apps/bin/dbcheck.sh |
| 代码: |
0 23 * * 6 /apps/bin/qtrend.sh |
| 代码: |
crontab [-u user] -e -l -r |
| 代码: |
EDITOR=vi; export EDITOR |
| 代码: |
#(put your own initials here) echo the date to the console every #15 minutes between 6pm and 6am 0,15,30,45 18-06 * * * /bin/echo 'date' > /dev/console |
| 代码: |
$su sam crontab samcron |
| 代码: |
#su # cat /var/spool/cron/sam # DO NOT EDIT THIS FILE - edit the master and reinstall. # (samcron installed on Wed Nov 10 21:41:55 2004) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) #(put your own initials here) echo the date to the console every #15 minutes between 6pm and 6am 0,15,30,45 18-06 * * * /bin/echo 'date' > /dev/console |
| 代码: |
$ crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (samcron installed on Wed Nov 10 21:41:55 2004) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) #(put your own initials here) echo the date to the console every #15 minutes between 6pm and 6am 0,15,30,45 18-06 * * * /bin/echo 'date' > /dev/console |
| 代码: |
$ crontab -l > $HOME/mycron |
| 代码: |
$ crontab -e |
| 代码: |
#DT:delete core files,at 3:30am on 1,7,14,21,26 days of each month 30 3 1,7,14,21,26 * * /bin/find -name "core" -exec rm {} \; |
| 代码: |
#(put your own initials here) echo the date to the console every #15 minutes between 6pm and 6am 0,15,30,45 18-06 * * * /bin/echo 'date' > /dev/console #DT:delete core files,at 3:30am on 1,7,14,21,26 days of each month 30 3 1,7,14,21,26 * * /bin/find -name "core" -exec rm {} \; |
| 代码: |
$ crontab -r |
| 代码: |
$ crontab <filename> |
| 代码: |
at [-f script] [-m -l -r] [time] [date] |
| 代码: |
以在a t命令后面跟上日期/时间并回车。然后就进入了a t命令提示符,这时只需逐条输入相应的命令,然后按‘ < C T R L - D >’退出。 |
| 代码: |
at [-f script] [-m -l -r] [time] [date] |
| 代码: |
# su sam $ at 10:40 warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh at> find /etc -name "passwd" -print at> <EOT> job 1 at 2004-11-02 10:40 |
| 代码: |
at 5.00am May23 at 11.20pm at now +2 hour at 9am tomorrow at 15:00 May24 at now + 10 minutes |
| 代码: |
$ touch db_table.sh $ at 3:00pm tomorrow -f db_table.sh warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh job 3 at 2004-11-02 15:00 |
| 代码: |
$ echo find /etc -name "passwd" -print | at now +1 minute warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh job 4 at 2004-11-01 19:07 |
| 代码: |
$ at -l 1 2004-11-02 10:40 a sam 3 2004-11-02 15:00 a sam 4 2004-11-01 19:07 a sam |
| 代码: |
# pwd /var/spool/at # ls -l |
| 代码: |
atrm [job no] 或at -r [job no] |
| 代码: |
$ at -l 1 2004-11-02 10:40 a sam 3 2004-11-02 15:00 a sam 4 2004-11-01 19:07 a sam $at -r 3 $at -l 1 2004-11-02 10:40 a sam 4 2004-11-01 19:07 a sam |
| 代码: |
| 命令& |
| 代码: |
command >out.file 2>&1 & |
| 代码: |
# find /etc/httpd/ -name "httpd.conf" -print >find.dt 2>&1 & [2] 7832 [1] Done find /etc/ -name "httpd.conf" -print >find.dt 2>&1 & |
| 代码: |
# cat find.dt /etc/httpd/conf/httpd.conf [2]+ Done find /etc/httpd/ -name "httpd.conf" -print >find.dt 2>&1 & |
| 代码: |
$ps psl & [7878] |
| 代码: |
# ps -x |grep 7832 7868 pts/0 S 0:00 grep 7832 |
| 代码: |
# ps -ef |grep 7832 root 7866 7790 0 23:40 pts/0 00:00:00 grep 7832 |
| 代码: |
kill -signal [process_number] |
| 代码: |
$kill 7832 |
| 代码: |
$kill - 9 7868 |
| 代码: |
nohup command & |
| 代码: |
nohup command > myout.file 2>&1 |
| 代码: |
$nobup ps1 & |
| 代码: |
$ps x |grep ps1 |
| 代码: |
cat /home/accounts/qrt_0499 | /apps/bin/trials.awk | sort | lp $cat > quarterend cat /home/accounts/qtr_0499 | /apps/bin/trials.awk | sort | lp <ctrl-D> |
| 代码: |
$ chmod 744 quarterend |
| 代码: |
nobup ./quarterend > qtr.out 2> |
| 代码: |
#ls [io]* |
| 代码: |
#ls log.[0-9]* |
| 代码: |
#ls log.[!0-9]* |
| 代码: |
#ls LPS??1 |
| 代码: |
$ ls [A-Z]* |
| 代码: |
$ ls [a-z]* |
| 代码: |
$ ls [0-9]* |
| 代码: |
$ ls .* |
评论列表