System Administration HW3 Shell Script changlp. Computer Center, CS, NCTU 2 Requirements  User socket statistic (20%) Use one-line command to show per-user.

Slides:



Advertisements
Similar presentations
Ovid Training Dept 2012 Setting up eTOC Subscriptions.
Advertisements

Unit 5 – User Administration Randy Marchany VA Tech Computing Center.
Professional Toolkit V2.0 C:\Presentations - SmartCafe_Prof_V2.0 - bsc page 1 Professional Toolkit 2.0.
Introduction to SPSS Allen Risley Academic Technology Services, CSUSM
System Administration Final Project - Micro Computer Center hchung, hwchiu.
Git/Unix Lab March Version Control ●Keep track of changes to a project ●Serves as a backup ●Revert to previous version ●Work on the same files concurrently.
Introduction to Perl Software Tools. Slide 2 Introduction to Perl l Perl is a scripting language that makes manipulation of text, files, and processes.
Guide To UNIX Using Linux Third Edition
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
The basics of the Online Portal
System Administration HW1-1 changlp. Computer Center, CS, NCTU 2 Requirements  Basic Install up-to-date –RELEASE of FreeBSD  8.2-R Add a user and a.
Va-scanCopyright 2002, Marchany Unit 6 – Solaris File Security Randy Marchany VA Tech Computing Center.
System Administration HW2 - FTP, Samba, BT, ZFS jwbai.
Final Project – NFS and NIS jwbai. Computer Center, CS, NCTU 2 Goal master.passwd passwd group netgroup amd.conf userA, /nis/home/userA userB, /nis/home/userB.
System Administration HW1 huanghs. Computer Center, CS, NCTU 2 Requirements  Basic Install FreeBSD and upgrade to up-to-date –RELEASE Recompile your.
Chapter 9 Scripting RMAN. Background Authors felt that scripting was a topic not covered well Authors wanted to cover both Unix/Linux and Windows environments.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
Linux Operations and Administration
The WinMine Toolkit Max Chickering. Build Statistical Models From Data Dependency Networks Bayesian Networks Local Distributions –Trees Multinomial /
Writing C-shell scripts #!/bin/csh # Author: Ken Berman # Date: # Purpose: display command and parameters echo $0 echo $argv[*]
SUSE Linux Enterprise Desktop Administration Chapter 6 Manage Software.
Agenda Getting Started: Using Unix Unix Structure / Features Elements of the Unix Philosophy Unix Command Structure Command Line Editing Online Unix Command.
Linux file system "On a UNIX system, everything is a file; if something is not a file, it is a process." Sorts of files (on a Linux system) Directories:
System Administration HW2 Shell Script xclin. Computer Center, CS, NCTU 2 Requirements  Xferlog statistics (15%) use one-line command to show FTP transfer.
System Administration Practice Homework 1-2 : X Window System lctseng.
Homework 03 - Hint DNS. Computer Center, CS, NCTU 2 Architecture ns.a.nctucs.net a.a /24 ns.b.nctucs.net b.b /24.
Homework 03 DNS. Computer Center, CS, NCTU 2 Architecture ns.a.nctucs.net a.a /24 ns.b.nctucs.net b.b /24 slave.
System Administration HW2 - File System Server ylin.
System Administration HW2 - File System Server. Computer Center, CS, NCTU 2 FTP  Install a FTP server for FreeBSD Pure-FTPd: /usr/ports/ftp/pure-ftpd.
Shell Scripting – Putting it All Together. Agenda Escaping Characters Wildcards Redirecting Output Chaining and Conditional Chaining Unnamed and Named.
System Administration HW5 - Micro Computer Center yihshih / lctseng.
POWERSHELL BASICS. BACKGROUND  Powershell is a task automation and scripting language based off the.NET framework  It provides the user full access.
File Handling in QBASIC
System Administration Practice Homework6 - LDAP login + Puppet + Jail yench / lctseng / chchang2222.
Blogging with RSS. Learning Opportunities © Pam Miller Course RSS feeds Aggregators Using RSS feeds for educators.
System Administration HW3 - Shell Script chenyp. Computer Center, CS, NCTU 2 Requirements  File statistics (20%+10%) use one-line command to show files.
Horner Fxp Facilities July 2007 Horner APG. What is Fxp? Fxp (File Exchange Protocol) is intended as an alternative to Ftp for Ocs units with Removable.
CS 403: Programming Languages Lecture 20 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Batch Files More flow of control Copyright © by Curt Hill.
System Administration Practice Homework 1-3 : Chinese World lctseng.
Network administration HW3 吳宗翰 wutzh. Computer Center, CS, NCTU 2 Architecture.
System Administration HW3 - Shell Script hchung. Computer Center, CS, NCTU 2 Requirements  User connect time statistic script (10%) Use one-line command.
Tutorial of Unix Command & shell scriptS 5027
Linux 101 Training Module Linux Basics.
System Administration Practice Homework 2: Shell Programming
Homework 3 frank.
Linux file system "On a UNIX system, everything is a file;
Submit BOSS Jobs on Distributed Computing System
“Real Simple Syndication” (RSS)
System Administration Practice Homework 1-1 : FreeBSD Base
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Operating Systems and Using Linux
Tutorial of Unix Command & shell scriptS 5027
Operating Systems and Using Linux
Chapter Four UNIX File Processing.
Final Project– NFS and NIS
Tutorial Unix Command & Makefile CIS 5027
Compute System Administration Homework 2: Shell Script
Computer System Administration Homework 3 – File Server
Windows RSS Platform Aleksej Karelin.
System Administration HW5 - Micro Computer Center
Periodic Processes Chapter 9.
System Administration HW3 - File System Server
System Administration Practice Homework2 - File System Server
Operating Systems and Using Linux
System Administration HW2 - File System Server
System Administration Practice
Chapter 9: Configuring Internet Explorer
Presentation transcript:

System Administration HW3 Shell Script changlp

Computer Center, CS, NCTU 2 Requirements  User socket statistic (20%) Use one-line command to show per-user socket statistic  ZFS snapshot management script (20%) Script for ZFS snapshot management/rolling  RSS feed reader (60%) A simple RSS feed reader using cdialog(1)

Computer Center, CS, NCTU 3 User Socket Statistic – Requirements (1/2)  Use one-line command to show user socket statistic $ sockstat  The output should be sorted by socket count in descending order  Socket count threshold Use environment variable ‘THRESHOLD’ Treat as 0 if ‘THRESHOLD’ is not set  Output format User: count ( processes… )

Computer Center, CS, NCTU 4 User Socket Statistic – Requirements (2/2)  Only pipes (cmd | cmd) and backquotes (`cmd`) are allowed  No temporary files and variables (e.g. environment vars except THRESHOLD)  No “&&” “||” “>” “>>” “<“

Computer Center, CS, NCTU 5 User Socket Statistic - Example

Computer Center, CS, NCTU 6 ZFS Snapshot Management Script – Requirements (1/2)  Write a script to do ZFS snapshot and snapshot rolling cron(8)  Syntax zfsSnap.sh -f -n | -d> -f  Target ZFS dataset -n  Name of ZFS snapshot -c  Number of ZFS snapshot copy to preserve -d  Delete snapshots in with Note that –c and –d are exclusive options

Computer Center, CS, NCTU 7 ZFS Snapshot Management Script – Requirements (2/2)  Logging with syslog logger(1) Please log PID, script name into local7.notice Your script should output log when  Old snapshots rotated  New snapshots taken  Snapshots deleted Oct 27 15:32:08 Archon zfsSnap[2699]: Old snapshot: rotated Oct 27 15:32:10 Archon zfsSnap[2709]: New snapshot: Oct 27 15:32:13 Archon zfsSnap[2727]: Deleted snapshots:

Computer Center, CS, NCTU 8 ZFS Snapshot Management Script - Example  Create snapshot (-c count)  Delete snapshot (-d)

Computer Center, CS, NCTU 9 RSS Feed Reader – Requirements (1/2)  Write a simple RSS reader with GUI devel/cdialog  Support the following functions Read (15%)  Read subscribed feed Add (15%)  Add new subscription Delete (15%)  Delete existing subscription Update (15%)  Update subscription  Please store all files into./feed/

Computer Center, CS, NCTU 10 RSS Feed Reader – Requirements (2/2)

Computer Center, CS, NCTU 11 RSS Feed Reader – Read back

Computer Center, CS, NCTU 12 RSS Feed Reader – Add Use site title as default feed name

Computer Center, CS, NCTU 13 RSS Feed Reader – Delete  You must remove related files / directories

Computer Center, CS, NCTU 14 RSS Feed Reader – Update

Computer Center, CS, NCTU 15 RSS Feed Reader – RSS Parser  For simplicity, TA would provide a simple RSS parser  README  Write your own one textproc/hs-feed textproc/p5-XML-FeedPP textproc/pear-XML_Feed_Parser textproc/py-feedparser textproc/ruby-rss

Computer Center, CS, NCTU 16 Hand-in  Due 2011/11/15 18:30  Demo & How TBA

Computer Center, CS, NCTU 17 Help  IRC channel #nctuNASA on freenode  Newsgroup cs.course.sysadmin  BBS bs2.to board CS-SysAdmin   Goto CSCC to ask professional 3F!