Selective Backup

At home, applications such as raid are less interesting. The most important thing is not to loose data. If something breaks down in the server, it has to be repaired. At least double storage is then the motto.

For the backup rsync is used a utility of the same functionality as robocopy from Microsoft. We put the commands into a script so that we can automatically run e.e.a. and a log file is created so that we can see every day whether e.e.a. has functioned properly.

Open a new file:
sudo nano backup-hover-data 
Put the following text in the file:

##
## Script to make a backup from a directory of one disk to another.
## c e e s @ i n r i j e n . n l @ 2013-01-11
##
# Log the start time of the script
TIMESTART=`date +%s`
FILENAME=`date +"/media/d1/Backup_20%y-%m-%d_%H:%S"`
echo "*** Backup start time (Unix seconds): $TIMESTART" > $FILENAME
#
# Do the copy action(s)
echo "*** Start met bibliotheek." >> $FILENAME
rsync -av --delete /media/d1/bibliotheek/ /media/d2/bibliotheek/ >> $FILENAME
echo "*** Start met system." >> $FILENAME
rsync -av --delete /media/d1/system/ /media/d2/system/ >> $FILENAME
echo "*** Start met hover-backup." >> $FILENAME
rsync -av --delete /media/d1/hover-backup/ /media/d2/hover-backup/ >> $FILENAME
#
TIMEFINISH=`date +%s`
TIMEELAPSED=`expr $TIMEFINISH - $TIMESTART`
echo "*** Backup done in $TIMEELAPSED seconds." >> $FILENAME
echo "Backup done in $TIMEELAPSED seconds"

Make the file bootable:
sudo chmod a+x /home/system/backup-hover-data

Create a cron job in WebMin so that the backup runs weekly, daily or at least as often as desired. On the / media / d1 drive a log file is kept of each separate backup so that copied and deleted files can be viewed.

This page is currently under reconstruction!!

Last updated 27 september 2018

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *