How to Do a Differential Backup for Linux

How to Do a Differential Backup for Linux thumbnail
Create a differential backup in Linux

Backing up your computer files allows you to restore your computer to its previous settings easily after a loss of data. A differential backup saves any changes made since the last full backup of your system. This method works faster than a full backup since it saves only files that have changed since your last full backup. Restoring your files using differential backup also works faster for the same reason. In Linux, you can create a differential backup using a few simple commands.

Things You'll Need

  • External storage device (external hard disk drive or USB flash drive)
  • Computer running the Linux operating system
  • Knowledge of Unix Shell and basic Unix commands
Show More

Instructions

    • 1

      Connect the external storage device to your computer.

    • 2

      Open a text editor (examples of text editors in Linux include gedit, GNU Emacs, and vim), and type the following commands:

      DATE=$(date +"%d-%m-%Y")

      FILE="$DATE-backup.tar.gz"

      tar -g /root/gnutar.incremental.txt -zcvf $FILE /home

      These commands save the contents of your /home directory in .tar file format. The backup file name will contain the date you created it (for example, "25-12-2008-backup.tar.gz" if you created it on December 25, 2008). Save the file as "diff-backup.sh" (without quotation marks).

    • 3

      Enter the command "chmod +x diff-backup.sh" (without quotation marks) in the shell, which will allow you to run the script.

    • 4

      Run the script using the command "./diff-backup.sh" (without quotation marks). Expect the process to take some time, depending on how many files you are backing up.

    • 5

      Once the backup completes, you can move the backup file to the external storage device using the "mv" command, or click and drag the file into the storage device using the file manager.

Tips & Warnings

  • You can automate the backup process using the cron job scheduler. For more information, type "man cron" or "man crontab" (without quotation marks) into the terminal window.

  • Ensure the computer properly detects the external storage device. If the computer does not automatically detect the external storage device, you may need to mount it manually.

  • Before running a differential backup, you should already have a full backup. To create a full backup, use the command "tar -zcvf full-backup.tar.gz /home" (without quotation marks).

  • You may need administrative privileges (become "root") to run certain commands. Be careful what commands you run when you have these privileges, as you can cause irreversible damage to your file system.

Related Searches:

References

  • Photo Credit memory stick usb image by Photosani from Fotolia.com

Comments

You May Also Like

  • How to Make a Linux Incremental Backup

    Performing an incremental backup (as opposed to a full backup every time) is critical to the efficient, continued operation of a Linux...

  • Linux Backup Commands

    Linux Backup Commands. It doesn't matter what operating system you're using, no computer is immune to crashes and data loss. Your data...

  • Linux Backup Methods

    There are multiple methods for creating backups for the Linux Operating System. What method you choose is based on your disaster recovery...

  • How to Create Incremental & Differential Backups

    Sometimes bad things happen to good files. Consequently, it is wise to regularly back up your files. "Full backups" copy the entire...

  • How to Restore a Differential Backup

    The differential backup method is a good "interim" method to use between full backups, because it only backs up new or changed...

  • How to Use the Tar Command

    The most common way to deliver a batch of files from a Linux system is by using the "tar" command. When you...

  • Incremental Vs. Differential Backups

    Incremental and differential backups are types of computer backups that work in conjunction with full system backups to protect a computer's data....

  • Difference Between Incremental & Differential Backups

    Hard drive storage capacities keep growing as technology improves, but the risk of hard drive failure will never go away. Backing up...

  • How to Backup a File in Linux

    The Linux operating system has many configuration files. These files are normally plain text files that can be edited in any text...

  • Types of Backup in Linux

    The importance of having a backup solution you can depend on is self-evident. Computers running any variation of the Linux operating system...

  • How to Check a Rear Differential

    All rear-wheel-drive cars and trucks have a rear differential. The rear differential uses a gear set to change the rotation of the...

  • How to Easily Backup Linux

    Linux is a secure and stable operating system. But any operating system can fail because of hardware, user error or unknown bugs....

  • How to Choose a Backup Storage Device

    Time was, you could back up everything on your computer with floppy disks. Today, when one sound or graphics file could well...

  • How to Backup DVD Movies in Linux

    If you have a DVD that you need to copy, you can do so on your computer using a DVD-copying application. When...

  • Automated Backup for Linux

    While there a number of off-site backup services that offer automated backup programs, many are not compatible with the Linux operating system....

  • How to Get Tar Off a Cement Driveway

    Tar is used on a cement driveway to act as a sealer and to fill in cracks in the concrete. Because of...

Related Ads

Featured