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