Chapter 4 Backup & Recovery
Chapter 4 Backup & Recovery
• rm –r
• Multi user and multi tasking OS
What is archieving
• Data archiving is the process of moving data that is no longer actively
used
• An archive is a inactive information, in any format, is securely stored
for long periods of time.
• Repository- is a central place in which an aggregation of data is kept
and maintained in an organized way.
• It can include a simple list of files or files organized under a directory
or catalog structure (depending on how a particular program supports
archiving).
Difference in Backup and Archiving
• Backup refers to the process of creating copies of data to ensure its
availability and recoverability in case of data loss, system failures,
hardware malfunctions, accidental deletions, or other disasters.
• Key characteristics of backups:
• Recoverability:
• Frequent Updates:
• Retention
• Data Integrity
• Archiving involves the process of preserving data for long-term
storage and historical reference. Archived data is typically data that is
no longer actively used but needs to be retained for legal, regulatory,
historical, or business reasons. Archives focus on storing data
efficiently and securely while making it accessible when needed.
• Long-Term Storage:
• Limited Updates
• Data Reduction:
• backups are focused on ensuring data availability and recoverability in
case of data loss or system failures, while archives are focused on
preserving data for the long term, often to meet legal or regulatory
obligations. Both concepts are crucial for effective data management
and protection, and organizations often implement both backup and
archiving strategies as part of their data lifecycle management plans.
• Archived data is not a copy, but rather inactive and rarely altered data
that needs to be retained for long periods of time.
• Rather than stored in blocks, archived data is usually stored as a file or
object that can be stored with metadata
Backup Archive
The original data remains in place, Archived data is moved from its
Data Storage Method while a backup copy is stored in original location to an archive
another location storage location
• os2.c
• os3.c
• os4.c
• Extracting a gzip tar Archive *.tar.gz using option -xvzf :
• We can install the rsync package with the help of the following
package manager as per your Linux distribution.
• $ sudo apt install rsync [On Debian, Ubuntu and Mint]
1. Copy/Sync File Locally
• Here in this example, /root/rpmpkgs contains some rpm package files and you
want that directory to be copied inside /tmp/backups/ folder.
• 3 copies of data
• 2 copy of back up medium
• 1 copy of data offsite
Choosing a Backup Tool
• Linux has several tools for backing up and restoring files
1. dump : Old tools that work with filesystems. This tool supports two
types of operations: full backups and incremental backups.
• define these by levels ranging from 0 to 9. Level 0 commands dump to
perform a full backup of the entire file system. Levels 1 thru 9 instruct
the program to record all changes made since the last backup
2.tar : A standard backup tool, and by far the easiest to use
dump
• tape device /dev/st0 and you want to create a full backup of the
/dev/sda1 filesystem using dump
• Incremental backup means backing up everything that has changed since last full backup.
• With incremental backup, only the initial backup is a full one.
• Subsequent backups only stores changes that were made since the previous backup.
• Incremental backups reduce the time and network bandwidth required in full backups.
• Also called as differential backup
• Advantages
• Backing up is the fastest
• The storage space requirements are the lowest
• Disadvantages
• Restore is the slowest
How to Create a Linux Backup Plan
Types of media
Gzip command
• gzip test.txt
• o/p—test.txt.gz
• Several files
• gzip test1.txt test2.txt
• o/p----test1.txt.gz
• Test2.txt.gz
• View
• zcat test.txt.gz
gunzip command
• gunzip command is used to uncompress
• gunzip test.txt.gz
• gunzip test1.txt.gz test2.txt.gz
Bzip2
bzip2 test.txt
o/p---test.txt.bz2