Brauche mal Hilfe für #linux #debian #trixie #nas #usbraid #nfs #usb #rsync #bash.
Ich habe ein #Script das nicht funktioniert und doch funktioniert *grrrr*
(Script Begin)
#!/bin/bash
set -ex
# check for mount
grep /backup /etc/mtab > /dev/null || exit 1
# directory to backup
BDIR=/home/wilma_wein/
# Destination dir for rsync
DDIR=/media/backup
# excludes file - this contains a wildcard pattern per line of files to exclude
EXCLUDES=/root/rsy.excl
# BACKUPDIR=${1:-`date +%A`}
BACKUPDIR=${1:-"day"`date +%d`}
OPTS="--force
--ignore-errors \
--delete-excluded \
--exclude-from=$EXCLUDES
--delete --backup --backup-dir=$DDIR/$BACKUPDIR -a -v"
export PATH=$PATH:/bin:/usr/bin:/usr/local/bin
# if destination does not exist, make it;-)
[ -d $DDIR ] || mkdir $DDIR
# write logfile
echo oooooooooooooooooooooooooooooooooooooooooooo >> /root/rsy.log
date >> /root/rsy.log
# delete existing backup dir
[ -d $DDIR/$BACKUPDIR ] && (echo remaking $DDIR/$BACKUPDIR >> /root/rsy.log; rm -r $DDIR/$BACKUPDIR)
# now the actual transfer
rsync $OPTS $BDIR $DDIR/current >> /root/rsy.log
(Script Ende)
.
.
Dieses Script soll mir mein komplettes /home sichern und gelöschte dateien in den heutigen Tag (Ordner day20 anlegen) und die gelöschte oder alte Datei (sofern geändert) verschieben. Die geänderte neue Datei im BackUp Ordner belassen.
Folgende Laufwerke sind in meiner #fstab gemountet:
# Angeschlossenes USB RAID Laufwerk.
/dev/sdb1 /media/USBRaid ext4 auto,nouser,exec,async,noatime 0 0
# Network Attached Storage Synology
192.168.2.120:/volume1/backup /media/synology223j/backup nfs auto,user,exec,async,noatime 0 0
.
.
Das Script funktioniert einwandfrei mit dem #USBRaid Laufwerk (RAID 0 - Striping)
aber nicht mit dem #Synology #NAS (RAID 1 - Mirroring), dort wird mir mein /home auch im Tagesordner gespeichert.
.
.
??? Kann sich hier wer vorstellen oder weiß warum das mit der #NAS nicht funzt ???