歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> centos自動命令

centos自動命令

日期:2017/3/1 17:03:23   编辑:關於Linux
centos自動命令 yum install crontabs www.2cto.com 說明: /sbin/service crond start //啟動服務 /sbin/service crond stop //關閉服務 /sbin/service crond restart //重啟服務 /sbin/service crond reload //重新載入配置 查看crontab服務狀態:service crond status 手動啟動crontab服務:service crond start 查看crontab服務是否已設置為開機啟動,執行命令:ntsysv 加入開機自動啟動: chkconfig –level 35 crond on www.2cto.com 1,crontab命令 功能說明:設置計時器。 語  法:crontab [-u <用戶名稱>][配置文件] 或 crontab [-u <用戶名稱>][-elr] 補充說明:cron是一個常駐服務,它提供計時器的功能,讓用戶在特定的時間得以執行預設的指令或程序。只要用戶會編輯計時器的配置文件,就可以使 用計時器的功能。其配置文件格式如下: Minute Hour Day Month DayOFWeek Command 參  數: -e  編輯該用戶的計時器設置。 -l  列出該用戶的計時器設置。 -r  刪除該用戶的計時器設置。 -u<用戶名稱>  指定要設定計時器的用戶名稱。 2,crontab 格式 www.2cto.com 基本格式 : * *  *  *  *  command 分 時 日 月 周  命令 第1列表示分鐘1~59 每分鐘用*或者 */1表示 第2列表示小時1~23(0表示0點) 第3列表示日期1~31 第4列 表示月份1~12 第5列標識號星期0~6(0表示星期天) 第6列要運行的命令 # Use the hash sign to prefix a comment # +—————- minute (0 – 59) # | +————- hour (0 – 23) # | | +———- day of month (1 – 31) # | | | +——- month (1 – 12) # | | | | +—- day of week (0 – 7) (Sunday=0 or 7) # | | | | | # * * * * * command to be executed
Copyright © Linux教程網 All Rights Reserved