Download presentation
Presentation is loading. Please wait.
1
2000 Copyrights, Danielle S. Lahmani UNIX Tools G22.2245-001, Fall 2000 Danielle S. Lahmani email: lahmani@cs.nyu.edu Lecture 12
2
2000 Copyrights, Danielle S. Lahmani Unix System Management Maintain integrity of the system (e.g., security) Install new software Perform periodic Backup of user’s files Adapt software to local conditions Perform Recovery of lost data Inform users of new services and features
3
2000 Copyrights, Danielle S. Lahmani Who are the system administrators? You: on your PC Professional managers on large mini- computer systems
4
2000 Copyrights, Danielle S. Lahmani Maintaining System Integrity Superuser privileges User account administration Managing file system systems Booting process Backups Security
5
2000 Copyrights, Danielle S. Lahmani Superuser Superuser: privileged level for system administration login name root, uid of 0 bypasses Unix protection on files and directories (except for remote file systems) su
6
2000 Copyrights, Danielle S. Lahmani User account administration Add user –user login name –user uid, groupid –initial passwd –add home directory –user’s login shell delete users
7
2000 Copyrights, Danielle S. Lahmani File System Management Disk partitions Building a file system –newfs, mkfs Mounting a file system Unmounting a file system Checking file system consistency
8
2000 Copyrights, Danielle S. Lahmani Disk Partition Physical disk is formatted to divide it into partitions different partitions or slices used for: –root file system –swap –whole disk –operating system files –user files
9
2000 Copyrights, Danielle S. Lahmani UNIX file system File system: collection of files and directories on a disk or tape in standard UNIX file system format. Low capacity disks such as diskette have a a single file system large disks are partitioned into several file systems: –modularity –backup
10
2000 Copyrights, Danielle S. Lahmani Mount Utility When UNIX is started, the directory hierarchy corresponds to the file system located on a single disk called the root device. The mount utility allows a super-user to splice the root directory of a file system into the existing directory hierarchy. File systems created on other devices can be attached to the original directory hierarchy using the mount mechanism.
11
2000 Copyrights, Danielle S. Lahmani Mount Utility When mount is established, users are unaware of crossing mount points. File system may be detached from the main hierarchy using the umount utility. Links do not work across mounts (System V) Example: $ mount /dev/dsk1 /usr $ umount /usr
12
2000 Copyrights, Danielle S. Lahmani file system tools newfs: front end to mkfs : builds a file system mount: mounts a file system umount: unmount a file system fsck: File System Check Consistency
13
2000 Copyrights, Danielle S. Lahmani File System Types Under UNIX SVR4: multiple file system types are supported VFS: kernel mechanism (Virtual file system) supports all file system mechanisms and underlies all other file system types examples of file system types –nfs –ufs –/proc pseudo file system to read –pcfs: DOS file system mountable on UNIX
14
2000 Copyrights, Danielle S. Lahmani Backups tar cpio volcopy: copies an exact image of a whole file system from one disk to another disk or to tape. cron, crontab: run programs at specified times, can be used for scheduling regular backups
15
2000 Copyrights, Danielle S. Lahmani tar: archiving files tar: tape archiving –usage: tar [options] [files] –Designed for maintaining an archive of files on a magnetic tape. –Copy files or restore files from tape. –If any files are subdirectories, tar acts on the entire subtree.
16
2000 Copyrights, Danielle S. Lahmani tar: archiving files options –c creates a tar-format file –f filename to specify filename for tar- format file, default is /dev/rmt8. –If - is used for filename, standard input or standard output is used as appropriate –v verbose output –x allows to extract named files
17
2000 Copyrights, Danielle S. Lahmani tar: archiving files (continued) –t generates table of contents –r unconditionally appends the listed files to the archive files –u appends only files that are more recent than those already archived –L follow symbolic links –m do not restore file modification times –l print error messages about links it cannot find
18
2000 Copyrights, Danielle S. Lahmani cpio:copying files cpio copy file archives in from or out of tape or disk or to another location on the local machine cannot write to multiple volumes –cpio -idtu [patterns] –cpio -ov –cpio -pl directory
19
2000 Copyrights, Danielle S. Lahmani cpio (continued) cpio -i [dtu] [patterns] –copy in (extract) files whose names match selected patterns. –If no pattern is used, all files are extracted –During extraction, older files are not extracted (unless -u option is used)
20
2000 Copyrights, Danielle S. Lahmani cpio (continued) cpio -ov copy out a list of files whose names are given on the standard input. cpio -p [options] directory copy files to another directory on the same system. Destination pathnames are relative to the named directory examples:to move a directory tree: $find. -depth -print | cpio -pdumv /mydir
21
2000 Copyrights, Danielle S. Lahmani cron utility How to set up cron jobs: –set up a file of commands in the crontab format and install it so the job can run again and again at defined intervals create crontab file and install them in $HOME directory –crontab -e
22
2000 Copyrights, Danielle S. Lahmani Crontab entry 6 fields –minutes 00-59 –hours 0-23 –days/month 1-31 –months 1-12 –days/week 0-6 (Sunday is 0) –job to be executed * all legal values “,” multiple entries are separated by comma
23
2000 Copyrights, Danielle S. Lahmani Crontab Entry example 00 17 * * 1,2,3,4,5 /usr/backup run /usr/backup at 5pm Monday-Friday every week, in every month in every year
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.