Project

General

Profile

Feature #592

Basic full-server backup script

Added by Lincee about 10 years ago. Updated about 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Apps
Target version:
-
Start date:
08/01/2010
Due date:
% Done:

0%


Description

I have created a rather rudimentary script to backup the entire server to a USB disk

#!/bin/bash

usb_path="/media/disk/" 
usb_path1="/media/disk1" 
BEEP="/usr/bin/beep" 
BEEPRIGHT="-l 100 -f 2000 -n -l 150 -f 3000" 
BEEPFAIL="-f 523.251 -l 100 -D 100 -n -f 391.995 -l 100 -D 100 -n -f 329.628 -l 100 -D 100 -n -f 261.626 -l 200" 

DATE=$(date +%Y-%m-%d)
BACKUP_DIR="/var/hda/files" 

if [ -d $usb_path ]
    then
        SOURCE="$usb_path" 
            # copy the files to the first HDD
        # when the backup succeeded, lets make a sound to inform the outside world, and send a msg to the sysadmin
        /bin/tar -cpf $BACKUP_DIR $SOURCE/$DATE.tar
        $BEEP $BEEPRIGHT
            mailx -s"`hostname``userid` BACKUP SUCCESSFULL ON $DATE  " you@yourdomain.com < /dev/null

elif [ -d $usb_path1 ]
        then
        SOURCE="$usb_path1" 
        # copy the files to the seccond HDD
        # when the backup succeeded, lets make a sound to inform the outside world, and send a msg to the sysadmin
        /bin/tar -cpf $BACKUP_DIR $SOURCE/$DATE.tar
        $BEEP $BEEPRIGHT
        mailx -s"`hostname``userid` BACKUP SUCCESSFULL ON $DATE  " you@yourdomain.com < /dev/null

else
        # apearantly, there was no disk connected, so the backup failed!                
        # make a different noise, and send a msg to the sysadmin
        $BEEP $BEEPFAIL
        mailx -s"`hostname``userid` BACKUP FAIL ON  " you@yourdomain.com < /dev/null

fi

maybe with some adjustments it can be incorporated into the amahi dashboard, as a way for basic backup of server data!

History

#1 Updated by cpg about 10 years ago

  • Subject changed from Amahi basic backup support to Basic full-server backup script

Also available in: Atom