gibney.org
:
Technology
:
Linux
:
Incremental Backup Tool
(Entry Nr. 345, by user 1 |
edit
)
A shellscript that makes marvelous incremental backups<br> <br> Usage: <span class=span_content_bash>ge_backup.sh /some/folder/ my_backup</span><br> <br> <div class=div_content_code>#!/bin/bash if [ $# -ne 2 ] then echo echo "incremental backup" echo "usage: ge_backup.sh <source> <destination>" echo "example: ge_backup.sh /some/where/data/ backup" echo exit 1 fi rsync --delete \ -avu \ --backup \ --backup-dir=$(pwd)/$2.history/$(date +%Y-%m-%d-%H-%M-%S) \ $1 \ $2 \ | tee -a $2.log </div> <br> Characteristics of the backups:<br> <br> 2 Backupfolders:<br> <br> data<br> data.history<br> <br> You can rewind the contents of data by performing these 2 actions for every history-point:<br> <br> 1) Delete all files younger (linux command stat) then the history point<br> 2) Copy all files from the history point back to the data folder<br> <br> <h2>Known alternatives:</h2> <br> <span class=span_content_bash>rdiff-backup</span> - This is the way to go!<br> rdiff-backup does incremental backups not only on a file basis, but also on an "in file" basis that even works with binary files. So it keeps the history of each file in a very efficient way. It also has nice tools compare, recreate etc.<br> <br> <span class=span_content_bash>git</span> - The version control system<br> Might be worth a try. But at the moment git doesnt track empty directories (see http://kerneltrap.org/mailarchive/git/2007/7/17/251902)
Create a new entry at this position