2024-02-01
dump
’s Functionalitydump
creates tape archive files, traditionally used for backing up to magnetic tapes. However, these archive files can be stored on any device, including hard drives or network shares. Its strength lies in its ability to perform incremental backups, reducing backup time and storage space compared to full backups each time. dump
uses a complex algorithm to only back up data that has changed since the last backup.
Key Features of dump
:
dump
supports different levels of incremental backups (0 being a full backup, 1 being incremental based on 0, 2 based on 1, and so on).dump
Command SyntaxThe basic syntax of the dump
command is:
dump [-0|-1|-2|-i level] [-f device] [-L] [-v] [-u username] filesystem
-0
: Specifies a level 0 (full) backup.-1
, -2
, etc.: Specifies incremental backup levels (1, 2, and so on). Each level requires a previous level’s backup to be restored correctly.-f device
: Specifies the device or file to write the backup to. Replace device
with the path to a file (e.g., /backup/mybackup.dump
).-L
: Lists the files to be backed up, without actually backing them up. This is extremely useful for testing purposes.-v
: Enables verbose output, showing progress and details during the backup process.-u username
: Specifies the user to own the backed-up files.filesystem
: The filesystem to back up (e.g., /home
, /
).1. Creating a Full Backup:
This example creates a full backup of the /home
directory to a file named /backup/home.dump
:
sudo dump -0vf /backup/home.dump /home
2. Creating an Incremental Backup (Level 1):
Assuming you already have a level 0 backup (/backup/home.dump
), this command creates a level 1 incremental backup:
sudo dump -1vf /backup/home.dump.1 /home
3. Listing Files without Backing Up:
To see what files dump
would back up without actually performing the backup:
sudo dump -0Lf /dev/null /home
(We use /dev/null
as a dummy device because we don’t want to write the backup to a file.)
4. Restoring a Backup (using restore
)
The restore
command is used to restore backups created by dump
. The syntax is similar, but you specify the backup file using -f
and potentially specify a volume number if you need to restore incremental backups:
sudo restore -f /backup/home.dump /home
sudo restore -f /backup/home.dump.1 /home
sudo
as needed.dump
provides detailed messages indicating problems.This guide provides a foundational understanding of the dump
command. Further exploration of its options and features will improve your Linux backup and recovery capabilities. Remember to always test your backup and recovery procedures regularly to ensure they function as expected.