Incremental backups

Juan R. de Silva juan.r.d.silva at gmail.com
Tue May 18 23:31:52 UTC 2010


On Tue, 18 May 2010 11:04:52 -0400, H.S. wrote:

> Maxime Alarie wrote:
>> Hi,
>> 
>> 
>>  
>> I use Karmic 9.1 server, no UI!
>> 
>> I have a server with about 40GB of important documents  on it.  I have
>> setup a cronjob to backup a  filesystem  every night.. But now I would
>> like to implement incremental backups every day. Because its starting
>> to take too much space..
>> 
>> 
>>  
>> The way I do it at the moment is  that I tar.gz the file system  and
>> then I rsync to  sdb1. Once a week I rsync sdb1 with an external
>> disk...
>> 
>> 
>>  
>> I wondering if any of you know a good way to  setup incremental backups
>> using nothing but the shell, since I have no UI on that server..
>> 
>> 
>>  
>> Thanks.
> 
> I have used the procedure described here to create a shell script (also
> did this in perl and also in python) to create the scrips:
> http://www.mikerubel.org/computers/rsync_snapshots/
> 
> They are fairly easy to create once you read the link above. One of my
> scripts does hourly backups and the other does daily backups. The most
> important thing to consider is the directories or paths that you don't
> to backup. For example, I exclude all .[Tt]rash*, .[Cc]ache*, tmp/, etc.
> files and folders.
> 
> I put these rolling snapshots and back ups on a different drive on my
> computer (could be on the network as well). That drive is mounted a
> read-only normally, but the scrips first remount it to read/write mode,
> do their stuff, and reset it back to read-only mode, thus preventing any
> accidental deletions.
> 
> The advantage of using rsync and the way it handles hard links is that
> numerous backups of the same data do not use negligible extra space.
> Basically, only the changes take up the extra space. It is quite nifty
> actually!

I use the same system and I find it working flawlessly. Takes minimum of 
storage space and minimum time to make a next daily/weekly/monthly 
(whatever your preference is) snapshot. 

If you write your script that will run Rsync right way than it is easily 
customizable in terms of how many snapshots you want to keep, how often 
you want to make them. Basically the same script can be used to make 
either daily, and/or weekly, and/or monthly snapshots. (Unless you want 
you daily and weekly/monthly backup sets to be different but even then 
there is a minimum of customization involved). You only create different 
cron jobs.

People do use rdif-backup and some other tools that actually utilize 
Rsync under the hood. They probably find them easier to learn, or to 
maintain. I'm not sure why... 

I personally find it more logical and actually easier to use Rsync 
directly instead.






More information about the ubuntu-users mailing list