12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

234CHAPTER 10Techniques for Backup and RecoveryAfter the rsync command-line arguments are listed, the first directory listed is the source,and the second directory listed is the destination. If either directory is preceded by a hostnameand a colon (:), the directory is a remote directory. For example, to transfer allhome directories to the backup/ directory on the remote server backup.example.com:rsync -avz /home backup.example.com:backups/The -a argument stands for “archive” mode, meaning that rsync performs a recursivetransfer (the source directory, its subdirectories, the subdirectories of the subdirectories,and so on are transferred), symbolic links are preserved, permissions and time stamps arepreserved, groups are preserved, file ownership is preserved if it is root, and devices arepreserved if they are owned by root. If the -v argument is used, progress messages aredisplayed including how much data is sent and received and the average transfer rate.Using the -z argument compresses the data to be transferred, speeding up the time ittakes to transfer the files or the file differences.When transferring files with rsync, whether or not a trailing slash is included on thesource directory is important. In our example, a trailing slash is not used on the sourcedirectory so that the directory backups/home/ is created on the remote server and all thefiles in the /home/ directory on the local system are recursively copied into backups/home/on the remote server. If a trailing slash is specified on the source directory such as thefollowing:rsync -avz /etc/sysconfig/ backup.example.com:backups/configfiles/The source directory specified is not created in the destination directory. In our example,all the files in /etc/sysconfig/ on the local system are recursively copied into thebackups/configfiles/ directory on the remote server.TIPConsider using rsync in a custom shell script or as a cron task to schedule backups.Refer to Chapter 11 for details.For more information on rsync, including how to use the rsync daemon for transfers,refer to the manual page by using the man rsync command at a shell prompt.Recovery and RepairTo analyze or repair a system failure, you might need to boot into the system. But, what ifthe boot loader is corrupt or what if the filesystem can’t be mounted anymore? <strong>Red</strong> <strong>Hat</strong><strong>Enterprise</strong> <strong>Linux</strong> includes alternative boot methods for system repair: rescue mode, singleusermode, and emergency mode.After booted into one of these modes, a set of commonly used editors such as Emacs andVi are available along with commonly used utilities such as e2fsck for repairing a filesystemand grub-install for repairing the boot loader on an x86 or x86_64 system.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!