Backup

From MEPIS Documentation Wiki

Jump to: navigation, search

Contents

General

You should backup at least your home directory. MEPIS now includes the tools you need to backup your system easily!

It is not a good idea to backup to the same drive that your data is on. If that drive crashes, you've lost both your data & your backup! So, dig around in the basement, attic or swapmeet for an old hard drive. It only needs to be about the size of your home directory--not the size of your entire primary hard drive. If you can install the second hard drive on a different IDE slot from your home directory your backups will run faster, but this is not necessary.

Ghost software

You can make an image of your complete Mepis partition(s) to a file, using something like Partimage provided with Mepis 6.5, Ghost for Linux available here, or a commercial program such as Acronis, DriveImage, etc. You might only want to do this occasionally, but at least you can restore a 100% working snapshot of your system.

At this time, partimage does not work with the 64-bit version of MEPIS.

Keep

Keep (packaged with MEPIS 6.5, 7.0, 8.0 and installable from repos in 8.5) is a GUI front end program which uses Rdiff-Backup (see below) that functions as a backup system for KDE. The behavior is quite simple: you choose the files you want to backup, you set up the frequency and the number of backups you want to have, and Keep will back them up automatically.

Keep M7.png

To back up using Keep, follow these steps:

  1. Open the app, click on Add directory to backup
  2. Select a directory for backup, e.g. /home/username/Documents
  3. Choose a backup location, e.g. /mnt/someremotelocation. You can also back up over a network, see the Keep FAQs. NOTE: the target directory may not be formatted with the NTFS filesystem or you will get an error message.
  4. Decide on any backup options, e.g., how frequently the backup should occur
  5. Click on Finish
  6. Click on Backup now, highlight the source to back up, and click OK.

To restore a backed up directory:

  1. Open the app, click on Restore a directory
  2. Select the backup to restore
  3. Select the destination directory
  4. Choose a backup date to restore if there is more than one
  5. Click on Finish

Troubleshooting

  • The most common problem appear to some from permissions. Be sure the sources, the /usr/..../r_diff backup directory, and target directory all have the same permissions.

LuckyBackup

LuckyBackup is another good GUI backup program. It uses rsync as a backend and transfers over only changes made and not all data.
LuckyBackup can be installed from the MEPIS Community Repository. Here are the basic steps:

  • Open program, click Profile > New
  • Give a name to the backup you are setting up, e.g. Data
  • Click in the source space, and locate the folder you want to back up
  • Click in the Destination space, and locate where you want it to go
  • Click the Validate button to make sure the paths are correct
  • Click OK
  • Highlight the profile you have just created in the main windown, click Profile > Schedule
  • Click the Add button
  • Use the pull-down Profile menu to select the Profile you want to schedule
  • Set when you want it to run
  • Click cron-IT! and you're done

Make sure that the destination is routinely mounted.

SLBS

Simple Linux Backup Software or SLBS is a simple program for backing up a Linux desktop system. It includes two applications:

  1. The Simple Backup Configuration Program (SBCP). This wizard asks you a few simple questions about what to back up, where to back it up, etc. It records these answers in some configuration files and sets up automatic backups for you.
  2. The backup script, bkup. This shell script actually performs the backups based on the options you set in SBCP. It has no user interface – it is meant to be run automatically by the Linux scheduler, cron, or manually from a command line.

For a detailed description on setup and use, see here.

Rdiff-Backup

Rdiff-backup is a command line utility that backs up one directory to another. The target directory ends up a copy of the source directory, but extra reverse differences are stored in a special subdirectory of that target directory, so you can still recover files lost some time ago. The idea is to combine the best features of a mirror and an incremental backup.

Using a script

Rdiff-Backup is the muscle behind Keep (discussed above) and is easily run with a script. The script below applies to a default installation of MEPIS 6.x (root is hda1, swap is hda2 & home is hda3), and a second hard drive named hdb1. In MEPIS 7.0 and 8.0, the drives are typically named: root (sda1), swap (sda2), and home (sda3). Check your system for the correct drive names.

#!/bin/sh
#
# This Rdiff-Backup script backs up to a second hard drive & deletes orphaned backups older than 4 weeks.
# It must be run as root in order to mount the second hard drive
#
# Be sure to replace each instance of username with your real username!
#
# to restore files, issue the command: cp -a /mnt/hdb1/username /home
# to restore, but not overwrite: cp -a -i --reply=no /mnt/hdb1/username /home

# Mount the second drive
mount /dev/hdb1 /mnt/hdb1

# Backup everything in my home EXCEPT:
# any .iso's (which you can download again, if needed)
# any user's trash can (it's trash after all)
# the file on my desktop called TopSecret (just for example)
rdiff-backup --exclude '**.iso' --exclude '/home/*/.local/share/Trash/**' --exclude /home/username/Desktop/TopSecret /home/username /mnt/hdb1/username

# remove backups of any file that's been deleted for more than 4 weeks (I really must not need it after 4 weeks)
rdiff-backup --remove-older-than 4W /mnt/hdb1/username

# Unmount the second hard drive
umount /dev/hdb1

Save this script somewhere in your home directory so it won't get deleted when you install a newer version of MEPIS. Correct the username and the drives in the script. Now either add it to your menu or place a link on your desktop & make sure that you set the link/menu entry to run as another user: root. To backup, just click the link--it will ask you the root password to begin! When the hard drive light stops blinking, it's done--should take a few minutes.

Nightly Automated Back-ups

You can automate backups at shutdown: After completing the above, create a soft link called /etc/rc0.d/S001backup that points to your new backup script. Do this by opening up File Manager as root, then dragging your script into the folder /etc/rc0.d/, then renaming the script "S001backup." As shutdown is handled as root, no password is required to mount & unmount the backup drive at shutdown.

See also Automated backups with rdiff-backup

Links

Personal tools
In other languages