Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ###
- # 30/07/13
- # systembackup.sh
- # Backup Script für den Systemdatenträger
- #
- # Erstellt ein Image des Systemdatenträgers und sendet nach Abschluss des Vorganges eine Benachrichtigung über den Status
- ###
- #cron stoppen
- /etc/init.d/cron stop
- #Image erstellen
- START=$(date +%s)
- rsync -aAXv --exclude=storagepool/* --exclude=dev/* --exclude=proc/* --exclude=sys/* --exclude=tmp/* --exclude=run/* --exclude=mnt/* --exclude=media/* --exclude=lost+found --delete /* /storagepool/TimeMachine/Fileserver_Systembackup
- #Benachrichtigung über ergebnis versenden
- if [ $? -eq 0 ];
- then
- FINISH=$(date +%s)
- APIKEY=
- curl https://api.prowlapp.com/publicapi/add \
- -F apikey=$APIKEY \
- -F application=Fileserver \
- -F event="System Backup" \
- -F description="Backup erfolgreich abgeschlossen in $(( ($FINISH-$START) / 60 )) minutes, $(( ($FINISH-$START) % 60 )) seconds"
- else
- APIKEY=
- curl https://api.prowlapp.com/publicapi/add \
- -F apikey=$APIKEY \
- -F priority=2 \
- -F application=Fileserver \
- -F event="System Backup" \
- -F description="Backup fehlgeschlagen"
- fi
- #cron wieder starten
- /etc/init.d/cron start
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement