How best to make daily routine backups from netbook to 2 external HD's?

Paul Lemmons paul at lemmons.name
Sat Feb 4 01:39:52 UTC 2012


I use a simple shell script that uses rsync. It works perfectly for me.I
have included it below.

What you will see is first a check to see if my external drive is mounted.
It auto-mounts when plugged in. Next you will see several sections that
create backups of specific directories.

The cleverness of the script is in the rsync command used. What it does is
create a complete backup of all files every night into a new directory.
However, if the file has not changed from the last time it was backed up it
simply creates a hard-link to the previous backed up file. You can delete
old backups and still not lose access to the files that are refrenced in
later backups because they still have a hard link assigned to them. This
gives you the *appearance* of a full backup every night while only using
the space required to hold the deltas and a little overhead for the hard
links.

When you do an ls on the backup directory you will see a something-current
directory, which is the latest backup and then dated directories
representing when their backups were taken.

I have several versions of this script that operate in different ways but
the concept is the same. I am sure with a little chin scratching you could
modify it to meet your need.

#!/bin/sh

if [ -e $HOME/passport/backups ]
then
   date=`date "+%Y-%m-%dT%H:%M:%S"`

   echo "Backing up /home/paul"
   sudo rsync -axP --link-dest=$HOME/passport/backups/home-current
/home/paul $HOME/passport/backups/home-back-$date
   if [ -e $HOME/passport/backups/home-back-$date ]
   then
      rm -f $HOME/passport/backups/home-current
      ln -s $HOME/passport/backups/home-back-$date
$HOME/passport/backups/home-current
   fi

   echo "Backing up /etc"
   sudo rsync -axP --link-dest=$HOME/passport/backups/etc-current
/etc       $HOME/passport/backups/etc-back-$date
   if [ -e $HOME/passport/backups/etc-back-$date ]
   then
      rm -f $HOME/passport/backups/etc-current
      ln -s $HOME/passport/backups/etc-back-$date
$HOME/passport/backups/etc-current
   fi

   echo "Backing up /var/www"
   sudo rsync -axP --link-dest=$HOME/passport/backups/www-current
/var/www   $HOME/passport/backups/www-back-$date
   if [ -e $HOME/passport/backups/www-back-$date ]
   then
      rm -f $HOME/passport/backups/www-current
      ln -s $HOME/passport/backups/www-back-$date
$HOME/passport/backups/www-current
   fi
else
   echo "Passport not mounted. Backup Aborting"
fi


On Fri, Feb 3, 2012 at 5:02 PM, Basil Chupin <blchupin at iinet.net.au> wrote:

> On 04/02/12 02:17, Bas G. Roufs wrote:
>
>>
>> Dear Everybody
>>
>> So far, I have been making backups from time to time via Dolphin or
>> Midnight Commander: OK for one complete backup, but not effective for daily
>> routine focussed at only newly added or changed files. Of course, I have
>> been looking at this issue at the internet. Several packages and methods
>> are being mentioned there. However, I am wondering which method(s) and
>> package(s) work best in practice in my situation: Eee PC 1001 HA along with
>> Kubuntu 11.04 or 11.10, in combination with two external mass storage
>> devices - one HD to store at home, a 2nd one to always carry with me. In
>> fact, I am looking for a package which is able to help me as follows:
>>
>>  * making a first complete backup from all the text files, images,
>>    photo's, video's, etc. at each of the 2 external devices;
>>  * afterwords, making routine backups at each of the two devices
>>    while focussing only at files added or modified ever since the
>>    previous backup session.
>>
>>
> I don't the answer which you are seeking but I do have a suggestion as a
> work-around.
>
> Seeing as how you already use mc (Midnight Commander), you do know that
> you can click on the Column Heading "Modify Time" and the files get
> resorted with, say, latest down to earliest?
>
> But the other thing, of course, is that using mc you get to answer the
> question whether you want to overwrite files and according to the criterium
> you choose (eg, if size is different, if date is earlier, etc).
>
>  What else to take into account:
>>
>>  * I do not want to backup software which is available anyway in the
>>    repositories or elsewhere;
>>  * My netbook does not run 24/24hours - so I prefer to regulate the
>>    time schedule manually instead of relying on some automatic schedule.
>>
>> Be so kind to provide me with you practical experience and thoughts.
>> Thanks, respectfully yours,
>>
>> Bas Roufs.
>>
>>
> BC
>
> --
> A three-year-old boy was examining his testicles while taking a bath.
> "Mum" he asked, "are these my brains?"
> "Not yet," she replied.
>
> --
> kubuntu-users mailing list
> kubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/**
> mailman/listinfo/kubuntu-users<https://lists.ubuntu.com/mailman/listinfo/kubuntu-users>
>



-- 
Any society that would give up a little liberty to gain a little security
will deserve neither and lose both. --Benjamin Franklin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20120203/d2177f59/attachment.html>


More information about the kubuntu-users mailing list