星期三, 一月 21, 2009

RHCE Prerequisites-0121

cron

crontab -e
crontab -u username -e

Five schedule fields appear on the left side of each crontab entry:
minute, hour, day of month, month, and day of week.
0 17 * * *
0 17 * * 1
0,10 17 * * 0,2,3
0-10 17 1 * *
2 8-20/3 * * *

Backup and Restore

Tape Backups
Using magnetic tape in Linux depends on the ftape system using tarballs to group directories into single compressed backup files.

DVD/CD Backups
mkisofs -J -r -T -o /tmp/backhome.iso /home
cdrecord -v /tmp/backhome.iso

Hard Drive(RAID) Backups

gzip and bzip2
gzip big.jpg
bzip2 big.jpg

gzip -d big.jpg.gz
bzip2 -d big.jpg.bz2

tar
The tar command was originally developed for archiving data to tape drives. However, it's commonly used today for collecting a series of files, especially from a directory.
tar czvf home.tar.gz /home
tar xzvf home.tar.gz /home

System Log File Management
Log files are controlled by the syslogd daemon and organized in the /etc/syslog.conf file.

Basic TCP/IP Networking

ping
The ping command allows you to test connectivity-locally, within your network, and on the Internet.
assume your IP address is 192.168.122.43 and
the gateway address on your network is 192.168.122.99.

1:First test the integrity of TCP/IP on your computer.
# ping 127.0.0.1
2:see if you're properly connected to your LAN
# ping 192.168.122.43
3:ping the address of another computer on your network
# ping 192.168.122.78
4:ping the address for your gateway
# ping 192.168.122.99
5:If possible, ping the address of your network's connection to the Internet
6:finally, ping the address of a computer that you know is active on the Internet.

ipconfig
The ipconfig command can help you check and configure network adapters.

netstat
The netstat command is versatile; it can help you see the channels available for network connections, interface statistics, and more. One important version of this command, netstat -r, displays routing tables that can tell you if your computer knows where to send a message.

Configuring Name Resolution
Using four configuration files, Linux can help you translate computer host names to IP addresses.

/etc/sysconfig/network
to specify information about the desired network configuration.

/etc/hosts
to contains IP addresses and their corresponding hostnames.

When your system tries to resolve a hostname to an IP address or tries to determine the hostname for an IP address, it refers to the /etc/hosts file before using the name servers (if you are using the default Red Hat Enterprise Linux configuration). If the IP address is listed in the /etc/hosts file, the name servers are not used. If your network contains computers whose IP addresses are not listed in DNS, it is recommended that you add them to the /etc/hosts file.

/etc/resolv.conf
the IP address of each DNS server is listed with a simple line similar to this:
nameserver 192.168.0.1

/etc/host.conf
When your computer looks for an IP address, this file determines whether it searches through /etc/hosts or DNS first. This is usually a one-line file: order hosts,bind

But in most cases, this file has been superseded by /etc/nsswitch.conf

/etc/nsswitch.conf
The key directive in this file, with respect to name resolution, is
hosts: files dns

This is a more straightforward expression of where Linux looks for an IP address when it sees a host name. First, it looks at the file, /etc/hosts, and then it looks at the available DNS server, as defined in /etc/resolv.conf