Wednesday, March 7, 2012

What is a great portable hardware backup solution for a Ubuntu Linux setup?

We have found that there are not a whole lot of consumer-level devices out there made for an easy Linux backup solution. Anyone out there have a great setup that includes a portable backup that they can move offsite?What is a great portable hardware backup solution for a Ubuntu Linux setup?
Any USB harddriveWhat is a great portable hardware backup solution for a Ubuntu Linux setup?
I use Ubuntu and I back up my entire home folder to a Lacie 320 GB Mobile Disk.



I believe most USB storage devices such as memory sticks and portable hard drives work with Ubuntu.What is a great portable hardware backup solution for a Ubuntu Linux setup?
Backup with an Open Source tool or Script would be my suggestion. Copy the data to a location which can be burned to media or backed up to removable USB drive.



Simple Backup 鈥?The Benefits



* Easy to configure and use

* Free of charge

* Runs automatically in background

* Backup to remote locations via ssh or ftp

* Backup to any mounted disk

* Supports emergency recovery from scratch

* Rule based purge of old backup sets

* Open source software

* Log will be send automatically via local Unix mail (not Notes mail)



Simple Backup consist of mainly three parts:



1. Simple Backup Config a GUI Tool to configure everything

2. Simple Backup Restore a GUI Tool to restore files

3. a scheduled backup task for backup in the background



The backup destination directory will later contain subdirectories for each backup each containing a tar.gz file and additional files.





Backup using a script example:



!/bin/bash

# ----------------------------------------鈥?#

# --- Backup Script v1.0

# Note: type ' crontab -e ' and add a line to run this script like this:

# 0 16 * * * /home/%26lt;user%26gt;/scripts/backup-system # everyday @ 16:00 hours

# 0 */8 * * * /home/%26lt;user%26gt;/scripts/backup-system %26gt;/dev/null 2%26gt;%26amp;1 # every 8 hours try silently

# ----------------------------------------鈥?#



BACKUP_SRC="${HOME}" # --- source

BACKUP_DST="/media/BACKUP_DRIVE" # --- destination

declare EXCLUDES=( Cache/* *core* Trash/* ) # --- folders and files to exclude



ALERT=95 # --- percent drive full warning

LOG="$HOME/backup-system.log" # --- log file loc



# ----------------------------------------鈥?#



# --- is the backup drive mounted and ready ?

check_drive_avail(){



if ! [ -d ${BACKUP_SRC} ] || ! [ -d ${BACKUP_DST} ] ;then

echo "At least one of the following folders does not exist: "

echo "HOME=${BACKUP_SRC} BACKUP LOC=${BACKUP_DST}"

exit 7

fi

}

# --- is the backup drive getting full ?

check_drive_full(){



usep=`df -h | egrep "${BACKUP_DST}" | awk '{ print $5 }' | cut -d'%' -f1`

if [ $usep -ge $ALERT ]; then

echo "WARNING! Running out of space \"${BACKUP_DST} (${usep}% full)\" on $(hostname) as on $(date)"

# exit 7

fi

}



# --- Use rsync to backup to remote storage

rsync_home_dir_to_drive(){



rm -f /tmp/excludes %26gt;/dev/null 2%26gt;%26amp;1





for each in ${EXCLUDES[@]} ;do

echo $each %26gt;%26gt; /tmp/excludes

done



# --- starting rsync backup

rsync -vaz ${BACKUP_SRC} ${BACKUP_DST} --exclude-from '/tmp/excludes' %26gt; $LOG.err 2%26gt;%26amp;1 %26gt; $LOG

rm -f /tmp/excludes %26gt;/dev/null 2%26gt;%26amp;1





}

# --- Put date in both logs

stamp_log_files(){

echo "Backup of \"${BACKUP_DST} (${usep}% full)\" for $(hostname) on $(date)" %26gt;%26gt; $LOG

echo "Backup of \"${BACKUP_DST} (${usep}% full)\" for $(hostname) on $(date)" %26gt;%26gt; $LOG.err

}



# --- Main

# ----------------------------------------鈥?#



echo "RSYNC Backup Script "

echo "=======================================鈥?"

echo "Checking for required directories .......................[X]";sleep 1

check_drive_avail

echo "Checking for drive full .................................[X]";sl鈥?1

check_drive_full

echo "Backing up drive with rsync .............................[X]";sleep 1

rsync_home_dir_to_drive

echo "System backed up to remote drive ........................[X]";sleep 1

stamp_log_files

echo "Stamped log files .......................................[鈥?1

echo "Logs -%26gt; $LOG , $LOG.err"



# ----------------------------------------鈥?#

No comments:

Post a Comment