Chapter 5Advanced SUSE Linux Enterprise Server Administration (Course 3038) Chapter 5Manage Backup and Recovery*Advanced SUSE Linux Enterprise Server Administration (Course...

1 answer below »
Hi, I need a professional linux expert for suse linux. It will be for a short exam. The expert needs have idea aboutShell scripting, Basic Script elements, Control structures, Advanced Scripting techniques ,








Manage Backup and Recovery of the Server by developing a Backup Strategy etc. Do you have any professionalexpert??








Chapter 5 Advanced SUSE Linux Enterprise Server Administration (Course 3038) Chapter 5 Manage Backup and Recovery * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Objectives Develop a Backup Strategy Create Backup Files with tar Copy Data with the dd Command Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Objectives (continued) Mirror Directories with the rsync Command Automate Data Backups with the cron Service Troubleshoot the Boot Process of a SLES 9 System Configure and Install the GRUB Boot Loader Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Develop a Backup Strategy Objectives Choose a Backup Method Choose the Right Backup Media Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Choose a Backup Method Full backup Best possible method of data backup All system data is copied to a backup media once a day To restore data Most current backup media is copied back to the system’s hard disk Disadvantage Time frame available to perform backups (Backup window) Perform backups when the system is not used Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Choose a Backup Method (continued) Perform an incremental backup Perform a full backup once a week Then you perform a backup every day That copies only files that have changed since the backup the day before Advantage Backup window can be much smaller Disadvantage Recovery time is longer Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Choose a Backup Method (continued) Perform a differential backup Perform a full backup once a week Then you perform backups every day To record files that have changed since the last full backup Advantage To restore data from a differential backup, you need just two backup media Disadvantage Amount of data to be backed up grows every day Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Choose a Backup Method (continued) Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Choose the Right Backup Media Tape drives are used most often They still have the best price-to-capacity ratio Normally these are SCSI drives Other media for data backup include Writable CDs or DVDs, removable hard drives, and magnetic-optical (MO) drives Storage Area Networks (SANs) are also used SAN often uses magnetic tapes to store the data Store backup media separately from backed up systems Store sensitive backup media offsite Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Create Backup Files with tar Objectives Create tar Archives Unpack tar Archives Exclude Files from Backup Perform Incremental and Differential Backup Use tar Command-Line Options Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Create tar Archives tar format Container format for files and directory structures Extension of the archive files end in .tar Normally data in the archive files is not compressed You can use additional compression commands Directories are typically backed up with tar -cvf /backup/etc.tar /etc tar -cvf /dev/st0 /home View the contents of an archive by entering tar -tvf /backup/etc.tar Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Unpack tar Archives Unpack files from an archive tar -xvf /dev/st0 Extract just one file tar -xvf /test1/backup.tar -C /home/user1/.bashrc Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Exclude Files from Backup List of these files must be written in an exclude file Line by line List is then passed to tar with the option -X tar -cvf /dev/st0 /home -X exclude.files Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Perform Incremental and Differential Backups Use a snapshot for incremental backups Make a full backup with a tar command tar -cz -g /backup/snapshot_file -f /backup/backup_full.tar.gz /home Perform an incremental backup tar -cz -g /backup/snapshot_file -f /backup/backup_mon.tar.gz /home Use the find command to search for files to back up for differential backup Make a full backup tar -czf /backup/backup_full.tar.gz /home Back up all files that are newer than the full backup find /home -type f -newer /backup/backup_full.tar.gz -print0 | tar -cvf -null /backup/backup_mon.tar.gz -T- Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Use tar Command-Line Options Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Copy Data with the dd Command Command dd Converts and copies files byte-wise Can copy all kinds of data Including entire hard disk partitions Copy a file dd if=/etc/protocols of=protocols.org Copy a complete partition dd if=/dev/sda1 of=boot.partition Create a backup copy of the MBR dd if=/dev/sda of=/tmp/mbr_copy bs=512 count=1 Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Mirror Directories with the rsync Command Objectives Perform Local Copying with rsync Perform Remote Copying with rsync Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Perform Local Copying with rsync Mirror all home directories rsync -a /home /shadow Mirror the content of a directory and not the directory itself rsync -a /home/. /shadow Exclude files from backup rsync -a --exclude-from=/home/exclude /home/. /shadow/home Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Perform Local Copying with rsync (continued) Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Perform Remote Copying with rsync With rsync and SSH Log in to other systems Perform data synchronization remotely over the network Copy home directory of the user tux to a backup server rsync -ave ssh root@DA1:/home/tux /backup/home/ Backup of the home directory is copied back to the DA1 system rsync -ave ssh /backup/home/tux root@DA1:/home/ Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Automate Data Backups with the cron Service Automate backups in Linux with the cron service System jobs are controlled with the file /etc/crontab And the files in the directory /etc/cron.d System jobs are defined using scripts in directories /etc/cron.(hourly, daily, weekly, and monthly) Specify which users can create cron jobs with /var/spool/cron/allow and /var/spool/cron/deny Jobs of individual users Stored in files in the directory /var/spool/cron/tabs Processed with the command crontab Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Troubleshoot the Boot Process of a SLES 9 System Objectives System Boot Process Issues How to Boot a Corrupted System Directly into a Shell How to Boot a Corrupted System with the Installation Media How to Start and Use the SLES9 Rescue System Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * System Boot Process Issues Most common problems: The system cannot boot due to a misconfigured boot loader The system cannot boot because of file system corruption An init script has malfunctioned and is blocking the boot process The system does not start correctly because of hardware changes Access the file system of the corrupted system To detect and fix the problem Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * How to Boot a Corrupted System Directly into a Shell Boot screen of the GRUB boot loader Lets you pass parameters that modify the Linux kernel Before the kernel is actually loaded Use the Boot Options field At the bottom of the GRUB boot screen Boot parameter init=new_init_program Changes the first program loaded by the kernel To boot to a shell use init=/bin/bash Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * How to Boot a Corrupted System with the Installation Media Steps Insert the SLES 9 DVD and reboot the system Select Installation; then press Enter When YaST displays the language selection dialog box, select Accept Select Boot installed system; then select OK Select the root partition of the system you would like to boot; then select Boot Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * How to Start and Use the SLES 9 Rescue System Steps Insert the SLES 9 DVD and reboot the system From the boot menu, select Rescue System; then press Enter From the language selection dialog box, select your language; then press Enter At the prompt Rescue login, enter root Press the Enter key You are now logged into the Rescue System as root Mount the corresponding partition mount -t reiserfs /dev/hda6 /mnt Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Configure and Install the GRUB Boot Loader Objectives The Basic Functionality of a Boot Loader The Basics of GRUB How to Configure the GRUB Boot Loader Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * The Basic Functionality of a Boot Loader Basic tasks of a boot loader: Boot various operating systems Pass boot parameters to the Linux kernel Stages Stage 1 Program code for stage 1 is installed in the master boot record (MBR) of the hard disk Stage 2 Usually contains the actual boot loader Files of boot loader are located in the directory /boot Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * The Basics of GRUB GRUB is the standard boot loader of SLES 9 Features Stage 2 File System Drivers Includes file system drivers for ReiserFS, ext2, ext3, Minix, JFS, XFS, FAT, and FFS (BSD) GRUB Shell Enables interactive control of the boot manager Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Advanced SUSE Linux Enterprise Server Administration (Course 3038) * How to Configure the GRUB Boot Loader Edit the file /boot/grub/menu.lst Structure of the file General options are listed Options for the various operating systems That can be booted with the boot manager Example Advanced SUSE Linux Enterprise Server Administration (Course 3038) * Chapter 6 Advanced SUSE Linux Enterprise Server Administration (Course 3038) Chapter 6 Create Shell Scripts Advanced SUSE Linux Enterprise Server Administration (Course 3038) Objectives Use Basic Script Elements Use Variable Substitution Operators Use Control Structures Use Advanced Scripting Techniques Learn About Useful Commands in Shell Scripts Advanced SUSE Linux Enterprise Server Administration (Course 3038) Use Basic Script Elements Objectives Flow Charts for Scripts The Basic Rules of Shell Scripting How to Develop Scripts That Read User Input How to Perform Basic Script Operations with Variables How to Use Command Substitution How to Use Arithmetic Operations Advanced SUSE Linux Enterprise Server Administration (Course 3038) Flow Charts for Scripts Programming elements of a script Often visualized by using program flow charts Flow charts benefits Force author to lay down the steps the script should perform Provide a clear symbolic outline of the algorithm Advanced SUSE Linux Enterprise Server Administration (Course 3038) Flow Charts for Scripts (continued) Advanced SUSE Linux Enterprise Server Administration (Course 3038) The Basic Rules of Shell Scripting Shell script ASCII text file Contains commands to be executed in sequence Permissions for script file must be set to “r” and “x” chmod +x script.sh Run shell script with sh script.sh Create a /bin directory for scripts under each user’s home directory Add this directory to the user’s search path export PATH=$PATH:~/bin Advanced SUSE Linux Enterprise Server Administration (Course 3038) The Basic Rules of Shell Scripting (continued) Add an .sh extension to the script filename Make sure script filename is not identical to existing commands Elements of a script Start Commands Stop Advanced SUSE Linux Enterprise Server Administration (Course 3038) The Basic Rules of Shell Scripting (continued) Advanced SUSE Linux Enterprise Server Administration (Course 3038) Exercise 6-1 Produce Output from a Script In this exercise, you will produce output from a script using the echo command Advanced SUSE Linux Enterprise Server Administration (Course 3038) How to Develop Scripts That Read User Input Command read Used to create scripts that read user input Takes a variable as an argument And stores the read input in the variable Variable can then be used to process the user input Advanced SUSE Linux Enterprise Server Administration (Course 3038) How to Develop Scripts That Read User Input (continued) Advanced SUSE Linux Enterprise Server Administration (Course 3038) Exercise 6-2 Read User Input In this exercise, you will use the read command in a shell script to accept user input Advanced SUSE Linux Enterprise Server Administration (Course 3038) How to Perform Basic Script Operations with Variables Advanced SUSE Linux Enterprise Server Administration (Course 3038) Exercise 6-3 Simple Operations with Variables In this exercise, you will practice performing simple operations with variables Advanced SUSE Linux Enterprise Server Administration (Course 3038) How to Use Command Substitution Command substitution Output of a command is used in a shell command line or a shell script Example 1: printing output echo "Today is `date +%m/%d/%Y`" Example 2: assigning output to a variable TODAY=`date +%m/%d/%Y` echo "Today is $TODAY" Advanced SUSE Linux Enterprise Server Administration (Course 3038) Exercise 6-4 Use Command Substitution In this exercise, you will practice using command substitution Advanced SUSE Linux Enterprise Server Administration (Course 3038) How to Use Arithmetic Operations Bourne shell is limited in this regard Can perform operations by relying on external commands (such as expr) Bash shell Comes with built-in support for arithmetic operations Limited in the following ways Only supports operations with whole numbers All values are signed 64-bit values Needs to use external commands, such as bc, for floating-point calculations Advanced SUSE Linux Enterprise Server Administration (Course 3038) How to Use Arithmetic Operations (continued) Use the external command expr A=`expr $B + 10` Use the Bash built-in command let let A="$B + 10“ Use arithmetic expressions inside parentheses or brackets A=$((B + 10)) or A=$[B + 10] Use the built-in command declare declare -i A declare -i B A=B+10 Advanced SUSE Linux Enterprise Server Administration (Course 3038) Exercise 6-5 Use Arithmetic Operations In this exercise, you will practice using arithmetic operations Advanced SUSE Linux Enterprise Server Administration (Course 3038) Use Variable Substitution Operators Variable substitution operators Used to assign different
Answered 12 days AfterDec 07, 2022

Answer To: Chapter 5Advanced SUSE Linux Enterprise Server Administration (Course 3038) Chapter 5Manage...

Karthi answered on Dec 19 2022
32 Votes
Exam done.
Student scored: 1.33/4.33
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here