Académique Documents
Professionnel Documents
Culture Documents
Scheduling
• Starts:
– crontab command events
(regularly scheduled jobs)
– at command events
(one time only execution at specified time)
Format of entries:
minute hour date-of-month month day-of-week command
...
...
#0
#0 33 ** ** ** /usr/sbin/skulker
/usr/sbin/skulker
#45
#45 22 ** ** 00 /usr/lib/spell/compress
/usr/lib/spell/compress
#45
#45 23
23 ** ** ** ulimit
ulimit 5000;
5000; /usr/lib/smdemon.cleanu
/usr/lib/smdemon.cleanu >> /dev/null
/dev/null
00 11 * * * /usr/bin/errclear -d
11 * * * /usr/bin/errclear -d S,O 30 S,O 30
00 12
12 ** ** ** /usr/bin/errclear
/usr/bin/errclear -d-d HH 90
90
00 15
15 * * * /usr/lib/ras/dumpcheck >/dev/null
* * * /usr/lib/ras/dumpcheck >/dev/null 2>&1
2>&1
0,30,45
0,30,45 * * * * /usr/sbin/dumpctrl -k >/dev/null 2>/dev/null
* * * * /usr/sbin/dumpctrl -k >/dev/null 2>/dev/null
...
...
• A safer method:
## crontab
crontab -l
-l >> /tmp/crontmp
/tmp/crontmp
## vi /tmp/crontmp
vi /tmp/crontmp
## crontab
crontab /tmp/crontmp
/tmp/crontmp
## at
at 55 pm
pm Friday
Friday
banner
banner hello
hello >> /dev/pts/0
/dev/pts/0
<ctrl-d>
<ctrl-d>
job
job user.time.a
user.time.a will
will be
be run
run at
at date
date
## for
for hosts
hosts in
in lpar50
lpar50 lpar51
lpar51 lpar52
lpar52
do
do
rsh
rsh $host
$host "echo
"echo '<<EOF
'<<EOF nohup
nohup shutdown
shutdown -Fr'
-Fr' || at
at now
now ""
done
done
• To list at jobs:
at -l [user]
atq [user]
## at
at –l
–l
root.1118077769.a
root.1118077769.a Mon
Mon Jun
Jun 66 10:09:29
10:09:29 2007
2007
root.1118078393.a
root.1118078393.a Mon
Mon Jun 6 10:19:53 2007
Jun 6 10:19:53 2007
test2.1118079063.a
test2.1118079063.a Mon
Mon Jun
Jun 66 10:31:03
10:31:03 2007
2007
• To cancel an at job:
at -r job
atrm [job | user]
## at
at -r
-r test2.1118079063.a
test2.1118079063.a
at
at file: test2.1118079063.a
file: test2.1118079063.a deleted
deleted
Scheduling Records