This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

rsync-backup-script für inkrementelle backups
#1
Hallo Zusammen,

hier zur Anregung ein kleines Rsync-Backup-Skript. Das erste Backup wird als vollständiges Backup ausgeführt, alle folgenden werden mit Hilfe von Linux-Hardlinks als inkrementelle Backups ausgeführt. Auf das letzte Backup verweist am Ende der Ordner "last". Das Skript stammt nicht vollständig aus meiner Feder. Ich benutze es schon länger,  daher habe ich leider keine originale Quelle mehr.

Code:
#!/bin/bash

QUELLE=/home/user/
ZIEL=/home/user/NAS/linux-mint-pc/
IGNORE1=/home/user/NAS/
IGNORE2=/home/user/.cache/
HEUTE=$(date +%Y-%m-%d)

rsync -vrR --exclude="${IGNORE1}" --exclude="${IGNORE2}" --delete "${QUELLE}" "${ZIEL}${HEUTE}/" --link-dest="${ZIEL}last/"
ln -nsf "${ZIEL}${HEUTE}" "${ZIEL}last"

exit 0
Mein Heimatgrid: https://swissgrid.opensim.ch
Zitieren


Nachrichten in diesem Thema
rsync-backup-script für inkrementelle backups - von Jules Dreki - 26.09.2022, 21:02

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 3 Gast/Gäste