1. 程式人生 > >Linux學習第八周一次課(3月26日)

Linux學習第八周一次課(3月26日)

crontab -e systemctl enable disable start

10.23 linux任務計劃cron

技術分享圖片

技術分享圖片

每天淩晨3點執行命令,任務計劃為#crontab -e

0 3 * * * /bin/bash /usr/local/sbin/123.sh >>/tmp/123.log 2>>/tmp/123.log


每周一、三、五的雙數月的1到5日的淩晨3點執行命令,則為#crontab -e

0 3 1-5 */2 1,3,5 /bin/bash /usr/local/sbin/123.sh>>/tmp/123.log 2>>/tmp/123.log


啟動任務計劃,#systemctl start crond

查看是否運行,#ps aux | grep cron 或 #systemctl status crond

停止運行,#systemctl stop crond


查看具體任務計劃,#crontab -l


-r刪除任務計劃,#crontab -r

-u指定用戶,#crontab -u root


10.24 chkconfig工具


開機啟動項

技術分享圖片技術分享圖片

系統服務目錄為/etc/init.d

添加服務,chkconfig --add network

刪除服務,chkconfig --del network

開機啟動,chkconfig --level 3 network on

開機不啟動,chkconfig --level 345 network off

技術分享圖片技術分享圖片

技術分享圖片技術分享圖片

系統服務,7個級別,0級別為關機,1級別為救援模式,234為多用戶模式,5為圖形界面,6為重啟;


10.25 systemd管理服務

技術分享圖片

技術分享圖片

systemctl list-units --all --type=service 列出所有類型service;


10.26 unit介紹

技術分享圖片

技術分享圖片技術分享圖片

技術分享圖片


10.27 target介紹

技術分享圖片

技術分享圖片


擴展

1. anacron 技術分享圖片http://blog.csdn.net/strikers1982/article/details/4787226

2. xinetd服(默認機器沒有安裝這個服務,需要yum install xinetd安裝) 技術分享圖片http://blog.sina.com.cn/s/blog_465bbe6b010000vi.html

3. systemd自定義啟動腳本 技術分享圖片http://www.jb51.net/article/100457.htm


Linux學習第八周一次課(3月26日)