1. 程式人生 > >AIX下做定時任務注意事項

AIX下做定時任務注意事項

AIX定時任務和LINUX是一樣的,都是用crontab去做。那我們這裡就講解一下crontab的基本語法:

minute         hour         day         month         dayofweek         command

例如:

00 * * * * sh test.sh

那麼就是每個小時的整點執行這個指令碼

00 10 * * * sh test.sh

就是每天10點執行

這個沒有太多好說的,度娘上一堆解釋

關鍵是aix中要想定時任務可以執行,必須在sh指令碼中開頭加入. ~/.profile,例如,我這裡有個指令碼是執行刪除rman的歸檔日誌,內容如下:

. ~/.profile
rman target / log=/arch/rman_shell/arch_del.log cmdfile=/arch/rman_shell/arch_de
l.txt