歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> AIX下做定時任務注意事項

AIX下做定時任務注意事項

日期:2017/2/28 14:32:52   编辑:Linux教程

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

Copyright © Linux教程網 All Rights Reserved