1 / 22

Unix 系統管理 (程式安裝)

Unix 系統管理 (程式安裝). 上課時間: 89.05.20, 上午 8:30-11:30 上課地點: 資訊館 1樓訓練教室. TANet 竹苗區域網路中心訓練課程. Unix 管理系統介紹. 一般 Unix 程式安裝與管理 特殊安裝與管理程式 系統紀錄檔管理. 1. 一般 Unix 程式安裝. Ftp - 檔案傳送程式 gzip - 壓縮/解壓縮工具 tar - tape archive 工具程式 基本必讀文件 Configure - 自動組態判斷工具程式 編譯程式 - C compiler

Download Presentation

Unix 系統管理 (程式安裝)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unix 系統管理(程式安裝) 上課時間: 89.05.20, 上午 8:30-11:30 上課地點: 資訊館1樓訓練教室 TANet 竹苗區域網路中心訓練課程

  2. Unix 管理系統介紹 • 一般Unix程式安裝與管理 • 特殊安裝與管理程式 • 系統紀錄檔管理

  3. 1. 一般 Unix 程式安裝 • Ftp - 檔案傳送程式 • gzip - 壓縮/解壓縮工具 • tar - tape archive 工具程式 • 基本必讀文件 • Configure - 自動組態判斷工具程式 • 編譯程式 - C compiler • Make - 系統開發管理程式 • Patch - 檔案修補工具程式

  4. Ftp - 檔案傳送程式 • 取得程式原始檔 (可透過 http 或 ftp ) • Unix 程式共用資料蒐集站 • ftp.ncu.edu.tw • ftp.nsysu.edu.tw • ftp.nctu.edu.tw • 使用例子 • ftp ftp.ncu.edu.tw • 以 ftp 這個帳號 login, 密碼設 e-mail address • 傳送時, 請設定 binary 傳送格式

  5. Gzip -壓縮/解壓縮程式 • Gzip - gnu zip 程式 • 附檔名 .gz • 常見功能 • Gzip -d <zip-file> • 解開一個壓縮檔 • gzip <file> • 製造一個壓縮檔

  6. tar - tape archive 格式管理程式 • 附檔名 .tar • 基本用法 - 資料備份, 檔案傳送 • 常用功能 • tar xvf <archive-file> • 解開一個 archive 檔 • tar xvf tst.tar • tar cvf <archive-file> [src-dir] • 製造一個 arvhive 檔

  7. 程式套件必讀的相關文件 • README - 基本說明檔 • INSTALL- 安裝說明 • CHANGE - 發展歷史 • TODO - 將來的開發/更新計劃清單 • DOC/MAN - 相關文件說明 • FAQ - 常見問題

  8. shell programming • Shell 基本定義 • shell scripts 的簡介 • 常見的 shell 程式 • sh, csh, tcsh, bash • 實用的記錄程式 script

  9. script -實用的記錄程式 • 常見指令 script abc • 內容 Script started on Sat May 20 11:08:37 2000 ns1% cd /tmp ns1% ls filter-errs mutt-ns1-1851-0.bak mutt-ns1-8096-1.bak k mutt-ns1-21446-0.bak mutt-ns1-9388-2.bak k.bak mutt-ns1-25442-1.bak ps_data ns1% pwd /tmp ns1% exit ns1% script done on Sat May 20 11:08:43 2000 ~

  10. Configure -自動組態判斷程式 • 跨平台可執行的Shell script 檔 • 可用來製造個別平台的設定資料檔 • config.h 與 Makefile • 常見用法 • ./configure • 參考用法 ( advanced) • ./configure --help

  11. 編譯程式 - C compiler • 編譯程式 - 製造新的 Unix 程式 • 將許多原始程式(通常為 C 程式), 轉換成為可以執行的目的程式(object program) • gcc - 常見跨平台的 GNU C compiler • 目前最新的版本 gcc-2.95.2

  12. 常見附加檔名 • “.c” - C 程式原始檔 • “.h” -標頭檔, 附加在許多原始程式前頭 • “.o” - 程式組的中間檔 (object code) • “.tar” - tape archive 格式檔 • “.gz” - GNU zip 壓縮檔 • “.BAK” - 修補過的檔案

  13. Make-程式管理工具 • 基本功能 • 製造一組新程式 • 更新系統 • 安裝程式到系統上 • 常見用法 • make • make clean • make install • make update

  14. Patch - 檔案修補工具程式 • 修補部分檔案, 以利重新造一個新系統 • 程式有 bug, 臨時再重新改寫部分程式碼 • 程式改版升級, 只針對部分有更動者, 送出 patch 檔 • 其餘照舊, 不必全部重新安裝 • 常見用法 • patch -b -v < [patch-file] • 修補過的附檔 .BAK

  15. 2. 特殊程式管理工具 • Linux RPM 簡介 • RPM : Redhat Package Manager • FreeBSD CVS 簡介 • CVS : Concurrent Versions System

  16. 3. 系統紀錄管理 • 系統程式 • Syslogd • cron • 基本功能 • 追蹤與管理系統 • 相關的管理工具程式 • tail, head, crontab, gzip

  17. Syslogd - 系統紀錄程式 • Syslogd daemon • e.g. /usr/sbin/syslogd • /etc/syslog.conf 設定檔 • 更新設定檔後, 重讀設定 • kill -HUP ‘cat /etc/syslogd.pid` • 記錄檔備份管理 • log rotate and compress

  18. /etc/syslog.conf # $FreeBSD: src/etc/syslog.conf,v 1.9.2.1 1999/08/29 14:19:02 peter Exp $ # # Spaces are NOT valid field separators in this file. # Consult the syslog.conf(5) manpage. *.err;kern.debug;auth.notice;mail.crit /dev/console *.notice;kern.debug;lpr.info;mail.crit;news.err /var/log/messages mail.info /var/log/maillog lpr.info /var/log/lpd-errs cron.* /var/cron/log *.err root *.notice;news.err root *.alert root *.emerg * # uncomment these if you're running inn news.crit /da4/news/log/news.crit news.err /da4/news/log/news.err

  19. 常見的系統紀錄檔 • /var/adm/messages • /var/log/* • 常用的工具觀察程式 • tail 20 /var/adm/messages • 看最後 20 行 • head 20 /var/adm/messages • 看最前 20 行 • dmesg

  20. Cron - 定時管理程式 • cron daemon 定時系統管理程式 • crontab 管理編輯程式 • 輸出入 • crontab 基本格式的範例

  21. Crontab - 管理程式 • crontab -l • 列出相關帳號的 crontab 設定 • crontab <cron-file>

  22. Crontab 範例 #ident "@(#)root 1.12 94/03/24 SMI" /* SVr4.0 1.1.3.1 */ # # The root crontab should be used to perform accounting data collection. 0 2 * * 0,4 /etc/cron.d/logchecker 5 4 * * 6 /usr/lib/newsyslog 15 3 * * * /usr/lib/fs/nfs/nfsfind 0 2 * * * find /home/ntp-stats -mtime +3 -exec rm -f {} \; 0 12 * * * find /tmp -mtime +3 -exec rm -f {} \;

More Related