Linux 15.028 Themen, 107.048 Beiträge

Erstellen eines Skriptes zur Datensicherung vom Linux-Server au

Arudil / 2 Antworten / Baumansicht Nickles

Hallo, während meiner Ausbildung im IT-Bereich bin ich nun damit beauftragt worden ein Skript zu erstellen, welches vom Linux-Server aus die Sicherung von Produktionsdaten die dieser von einzelnen Windows-NT-Workstations zu sich hat transferieren lassen auf Magnetbänder zu sichern, dabei soll entsprechend in einer Log-Datei mitprotokolliert werden ob der Sicherungsvorgang auf dem Magnetband erfolgreich verlaufen ist. Hat jemand eine Idee wie dies funktionieren könnte?

bei Antwort benachrichtigen
alti75 Arudil „Erstellen eines Skriptes zur Datensicherung vom Linux-Server au“
Optionen

Vielleicht sowas, muß aber noch entsprechend angepasst werden. Mit RSYNC zu verwenden um ein incremetelles Backup zu erstellen.

##########################################################################################
backup to a central backup server with 7 day incremental

#!/bin/sh

# This script does personal backups to a rsync backup server. You will end up
# with a 7 day rotating incremental backup. The incrementals will go
# into subdirectories named after the day of the week, and the current
# full backup goes into a directory called "current"
# tridge@linuxcare.com

# directory to backup
BDIR=/home/$USER

# excludes file - this contains a wildcard pattern per line of files to exclude
EXCLUDES=$HOME/cron/excludes

# the name of the backup machine
BSERVER=owl

# your password on the backup server
export RSYNC_PASSWORD=XXXXXX


########################################################################

BACKUPDIR=`date +%A`
OPTS="--force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES
--delete --backup --backup-dir=/$BACKUPDIR -a"

export PATH=$PATH:/bin:/usr/bin:/usr/local/bin

# the following line clears the last weeks incremental directory
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
rsync --delete -a $HOME/emptydir/ $BSERVER::$USER/$BACKUPDIR/
rmdir $HOME/emptydir

# now the actual transfer
rsync $OPTS $BDIR $BSERVER::$USER/current


backup to a spare disk

I do local backups on several of my machines using rsync. I have an
extra disk installed that can hold all the contents of the main
disk. I then have a nightly cron job that backs up the main disk to
the backup. This is the script I use on one of those machines.

#!/bin/sh

export PATH=/usr/local/bin:/usr/bin:/bin

LIST="rootfs usr data data2"

for d in $LIST; do
mount /backup/$d
rsync -ax --exclude fstab --delete /$d/ /backup/$d/
umount /backup/$d
done

DAY=`date "+%A"`

rsync -a --delete /usr/local/apache /data2/backups/$DAY
rsync -a --delete /data/solid /data2/backups/$DAY



The first part does the backup on the spare disk. The second part
backs up the critical parts to daily directories. I also backup the
critical parts using a rsync over ssh to a remote machine.

Es gibt 10 Arten von Menschen auf der Welt. Diejenigen welche das Binärsystem verstehen und die, die es nicht tun.
bei Antwort benachrichtigen
AxelE Arudil „Erstellen eines Skriptes zur Datensicherung vom Linux-Server au“
Optionen

schau doch mal hier: www.ae-sys.de

bei Antwort benachrichtigen