Week 9 - Managing Backup and Recovery Flashcards
System backup
Copies files and directories to an archive
Use to restore data in case of system failure of data loss and corruption
Most common backup medium is tape
Archive
File containing many other files, each of which is still identified by its file name, owner, permissions, and timestamp
System backups in Linux
Directories to include in regular backups
/etc contains core configuration files, security files, network configuration files, user and group
information, etc
/home each user has a /home directory
/opt software and packages added after the default installation
/root root user’s home directory
/var system specific information that changes while the system is running normally
/srv server scripts
Tar Utility
Tar (tape archive) utility
Archives files
- creates archives by combining multiple files and directories into a single file
- originally designed to store files on magnetic tape
- now used to store files on a tape, hard disk, CD/DVD, or even on a network
Extracts files
- unpack members of an archive making them available to the file system
Common tar options
-c or –create
creates an archive file
-t or –list
Lists an archive’s contents
-x or –extract
Extracts an archive’s contents
-f or –file
Specifies the archive’s file name and location
-v or –verbose
Displays details about copying files to and extracting files from archives
-z or –gzip, –unzip
Filters an archive through gzip
Members
– Different from files
– Can be viewed only with the tar command’s t option
– Can extract all/some members from an archive
* e.g. When a user deletes a file accidentally
- r or –append
Adds files to existing archive
-u or –update
Compares the date and time of a member with the date and time of the file with the same name. If the file was modified after the archive was created, its newer version is added to the archive.
-A or –concatenate
Similar to append option but adds one archive to another archive
–delete
removes specific members from a tar archive. This option doesn’t have a short name
-d or –compare
compares specified members with files in the file system having the same name and reports difference in file size, mode, owner, modification date and contents
–mode
changes a member’s permissions in an archive with number or symbolic notation
–mtime
changes a member’s modification date in the tar archive
–owner
changes the member’s owner in the tar archive
–group
similar to –owner, except it’s user to change member’s group instead of owner
Full backup
Archive of all files on file system
Never perform a full backup while users are accessing the system - tar file could be corrupted if files are modified during backup process
tar command for full backup
tar -cvf backup0.tar -V “Comment” –listed-incremental =/home/backup.snap *
creates full backup of current directory
-cvf creates archive called backup0.tar
-v labels archive with the text between quotation marks
–listed-incremental creates a snapshot file named backup.snap which is used during incremental backups to determine which files have changed since the last backup
* what files to backup
Incremental backups
Archive containing only files modified since the last backup
– Companies have different backup strategies,
depending on their needs
– Incremental backup each night, full backup weekend
– Full Backup each night
- Syntax for creating an incremental backup
– Same as the command for full backups
– If the snapshot file already exists, the tar utility
examines it to determine whether any files have
changed