Backup: Unterschied zwischen den Versionen
Aus MeinWiki
(→Script) |
|||
Zeile 6: | Zeile 6: | ||
fileWrite1=$logPath1$logFile1 | fileWrite1=$logPath1$logFile1 | ||
− | mount -t cifs -o username= | + | mount -t cifs -o username="USERNAME",password="PAASWORT" //172.30.4.12/backup /mnt/backup |
if [ -f /mnt/backup/mount ]; then | if [ -f /mnt/backup/mount ]; then | ||
Zeile 23: | Zeile 23: | ||
logger "Fehler externes Backup" | logger "Fehler externes Backup" | ||
fi | fi | ||
− | + | ||
umount /mnt/backup | umount /mnt/backup |
Version vom 25. September 2015, 08:01 Uhr
Rdiff Backup
Script
#!/bin/bash logPath1=/var/log/backup/ logFile1=backup$(date "+%y%m%d").log fileWrite1=$logPath1$logFile1 mount -t cifs -o username="USERNAME",password="PAASWORT" //172.30.4.12/backup /mnt/backup if [ -f /mnt/backup/mount ]; then echo $(date "+%y%m%d-%H%M%S")' Start Backup' >> $fileWrite1 rdiff-backup --exclude-symbolic-links /mnt/daten1/bereich/ /mnt/backup/daten1/bereich/ >> $fileWrite1 rdiff-backup --exclude-symbolic-links /mnt/daten1/home/ /mnt/backup/daten1/home >> $fileWrite1 rdiff-backup --exclude-symbolic-links /mnt/daten1/profile /mnt/backup/daten1/profile >> $fileWrite1 rdiff-backup --exclude-symbolic-links /mnt/daten1/exchange /mnt/backup/daten1/exchange >> $fileWrite1 /etc/init.d/postgresql stop rdiff-backup --exclude-symbolic-links /var/lib/postgresql/9.3/main /mnt/backup/var >> $fileWrite1 /etc/init.d/postgresql start logger "Externes Backup Erfolgreich" echo $(date "+%y%m%d-%H%M%S")' Stop Backup' >> $fileWrite1 else echo $(date "+%y%m%d-%H%M%S")' Error Backup' >> $fileWrite1 logger "Fehler externes Backup" fi umount /mnt/backup