Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by...

17
Backups, Logging, Troubleshooting

Transcript of Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by...

Page 1: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Backups, Logging, Troubleshooting

Page 2: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Dates for Last Week of Class• Homework 7

– Due Tuesday 5/1 by midnight

• Labs 7 & 8– 8 is extra credit– Due Thursday 5/3 by midnight– No Late ones accepted

• Final – Thursday 5/3– 6 – 9:30 in classroom– open [book|notes|computer]– will need working VM

Page 3: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Backups

• What to backup?

• How often?

• Where?

• Don’t forget to test restores!!!

Page 4: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Backup Medium

• 2nd Hard Drive

• CDs, DVDs, Flash Drives

• Tape

• Another server

• Online

Page 5: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Backup Utilities

• tar

• cpio

• dump/restore

• zip/unzip

• dd

• really, really expensive commercial ones

Page 6: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Logs

• Controlled by 2 daemons– syslog – general logging– klogd – kernel messages

Page 7: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Syslog• Controlled by /etc/syslog.conf:# Log anything except mail of level info or higher.# Don't log private authentication messages!*.info;mail.none;authpriv.none;cron.none /var/log/messages

# The authpriv file has restricted access.authpriv.* /var/log/secure

# Log all the mail messages in one place.mail.* -/var/log/maillog

# Log cron stuffcron.* /var/log/cron

Page 8: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Syslog Format

• Basic syntax:codeword.priority location

• Example:

cron.* /var/log/cron

Page 9: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Syslog Codewords

• auth – message from a user authentication program this used to be called security

• auth-priv – private authentication program• daemon – any daemon not explicitly listed will generate a

message under this category• kern – kernel messages through klogd• syslog – messages about the logging process itself• user – messages from application software started by a

user • local0 through local7 – messages generated by Linux

where the level is established by the Linux vendor local7 for instance pertains to boot messages

• cron, lpr, mail, news – self explanatory

Page 10: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Syslog Priorities

• From lowest to highest:– none - no priority– debug - log debugging messages used by programmers or

testers of the software– info - log informational messages about what the program is

doing– notice - noteworthy events– warning - potential problem events– err – errors– crit - critical error messages that will likely cause the program to

terminate– alert - like crit except that the error can impact other programs– emerg - problems serious enough to potentially crash the entire

OS

Page 11: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Syslog location

• File: /some/path/to/file

• Remote: @loghost

Page 12: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Troubleshooting

• Log files in /var/

• man pages!!!!

• apropos (man –k) – search man pages for matches

• System monitoring commands – top, ps, etc

Page 13: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Software Installation

Page 14: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

How to install?

• Source

– Download .tar.gz, extract, make, make install

• Packages (2 biggest for Linux)

– RPM – Redhat Package Manager

– DEB – Debian Packages

• Commercial Unix

– bff for AIX – Backup File Format

– dstream for Solaris - shar

Page 15: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Package Managers

• CentOS Specific

– rpm (command line)

– yum (command line)

– pirut (Graphical front-end to yum)• “Applications” → “Add/Remove Software”

Page 16: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

yum

• yum – Yellowdog Updater Modified

– Used for installing new software

– Used for removing old software

– Used for updating current software

Page 17: Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.

Make

• Used to build software from sourceall: scheduler

scheduler: scheduler.o

g++ scheduler.o -o scheduler

scheduler.o: scheduler.C

g++ -c scheduler.C

clean:

rm -rf *o scheduler

install: scheduler

mkdir -p /usr/local/bin

cp scheduler /usr/local/bin