[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

(Gelöst) Inkrementelles Backup basiert auf Hardlinks?



Hallo nochmal.

Ich hab das jetzt mit einem simplen Script und rsync realisert. danke
nochmal an alle, die mir geholfen haben.

Für Interessierte:

---- SNIP ----
#!/bin/bash

newestfile() {
    lastfile=
    for i in $1/*; do
        if [[ "$lastfile" ]]; then
            [[ "$i" -nt "$lastfile" ]] && lastfile=$i
        else
            lastfile=$i
        fi
    done
    echo $lastfile
}

lastbackup=$(newestfile backups)
lastbackup=${lastbackup#backups/}
curdate=$(date +%Y-%m-%d-%H%M%S)
echo last backup: $lastbackup
echo new backup: $curdate
rsync -ahHRzv --link-dest=../$lastbackup --del --delete-excluded \
    --rsh="ssh" --exclude-from="exclude.list" root@stummi.org:/ \
    backups/$curdate/
---- SNAP ----

Liebe Grüße,
Micha


Reply to: