Benutzer-Werkzeuge

Webseiten-Werkzeuge


ubuntu:backup

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
ubuntu:backup [2026/04/12 10:48] – [Skript anlegen] franzubuntu:backup [2026/04/12 10:52] (aktuell) – [Skript anlegen] franz
Zeile 201: Zeile 201:
  
 <code bash> <code bash>
-\ 
 #!/bin/bash #!/bin/bash
  
Zeile 207: Zeile 206:
  
 LOGFILE="/var/log/rsnapshot_daily.log"\ LOGFILE="/var/log/rsnapshot_daily.log"\
-MAILTO="webmaster@waldhofer.com"\+MAILTO="webmaster@domain.at"\
 HOSTNAME="$(hostname -f 2>/dev/null || hostname)"\ HOSTNAME="$(hostname -f 2>/dev/null || hostname)"\
 LOCKFILE="/var/run/rsnapshot_daily.lock" LOCKFILE="/var/run/rsnapshot_daily.lock"
Zeile 228: Zeile 227:
       DATE_NOW="$(date '+%Y-%m-%d %H:%M:%S')"\       DATE_NOW="$(date '+%Y-%m-%d %H:%M:%S')"\
       echo "==== $DATE_NOW LOCK AKTIV: rsnapshot daily laeuft bereits ====">> "$LOGFILE"\       echo "==== $DATE_NOW LOCK AKTIV: rsnapshot daily laeuft bereits ====">> "$LOGFILE"\
-      send_error_mail \+      send_error_mail \ 
-          "[FEHLER] rsnapshot bereits aktiv auf $HOSTNAME" \\+          "[FEHLER] rsnapshot bereits aktiv auf $HOSTNAME" \
           "Der rsnapshot-Job wurde nicht gestartet, weil bereits ein Lauf aktiv ist.           "Der rsnapshot-Job wurde nicht gestartet, weil bereits ein Lauf aktiv ist.
  
Zeile 251: Zeile 250:
   else\   else\
       echo "==== Ende rsnapshot daily FEHLER ($RETVAL): $DATE_END ====">> "$LOGFILE"\       echo "==== Ende rsnapshot daily FEHLER ($RETVAL): $DATE_END ====">> "$LOGFILE"\
-      send_error_mail \+      send_error_mail \ 
-          "[FEHLER] rsnapshot Backup auf $HOSTNAME" \\+          "[FEHLER] rsnapshot Backup auf $HOSTNAME" \
           "Die rsnapshot-Sicherung ist fehlgeschlagen.           "Die rsnapshot-Sicherung ist fehlgeschlagen.
  
Zeile 276: Zeile 275:
 ==== Skript ausführbar machen ==== ==== Skript ausführbar machen ====
  
-<code bash>\\ +<code bash> 
-sudo chmod +x /usr/local/bin/rsnapshot_daily_monitor.sh\\+sudo chmod +x /usr/local/bin/rsnapshot_daily_monitor.sh 
  
 </code> </code>
  
 ---- ----
 +
  
 ==== Cronjob einrichten ==== ==== Cronjob einrichten ====
Zeile 287: Zeile 288:
 Root-Crontab bearbeiten: Root-Crontab bearbeiten:
  
-<code bash>\\ +<code bash> 
-sudo crontab -e\\+sudo crontab -e 
  
 </code> </code>
  
 Eintrag hinzufügen: Eintrag hinzufügen:
 +
 <code> <code>
-\\ +0 1 * * * /usr/local/bin/rsnapshot_daily_monitor.sh
-0 1 * * * /usr/local/bin/rsnapshot_daily_monitor.sh\\+
  
 </code> </code>
Zeile 307: Zeile 309:
  
 ---- ----
 +
  
 ==== Wichtige Regel ==== ==== Wichtige Regel ====
Zeile 313: Zeile 316:
  
 Also **nicht beides gleichzeitig**: Also **nicht beides gleichzeitig**:
- +<code> 
-<code>\\ +0 1 * * * /usr/bin/rsnapshot daily\ 
-0 1 * * * /usr/bin/rsnapshot daily\+0 1 * * * /usr/local/bin/rsnapshot_daily_monitor.sh
-0 1 * * * /usr/local/bin/rsnapshot_daily_monitor.sh\\+
  
 </code> </code>
Zeile 322: Zeile 324:
 Richtig ist nur: Richtig ist nur:
  
-<code>\\ +<code> 
-0 1 * * * /usr/local/bin/rsnapshot_daily_monitor.sh\\+0 1 * * * /usr/local/bin/rsnapshot_daily_monitor.sh
  
 </code> </code>
  
 ---- ----
 +
  
 ==== Funktion testen ==== ==== Funktion testen ====
Zeile 333: Zeile 336:
 Skript manuell starten: Skript manuell starten:
  
-<code bash>\\ +<code bash> 
-sudo /usr/local/bin/rsnapshot_daily_monitor.sh\\ +sudo /usr/local/bin/rsnapshot_daily_monitor.sh 
-echo $?\\+echo $? 
  
 </code> </code>
Zeile 346: Zeile 350:
 Logdatei ansehen: Logdatei ansehen:
  
-<code bash>\\ +<code bash> 
-sudo tail -n 50 /var/log/rsnapshot_daily.log\\+sudo tail -n 50 /var/log/rsnapshot_daily.log 
  
 </code> </code>
  
 ---- ----
 +
  
 ==== rsnapshot separat prüfen ==== ==== rsnapshot separat prüfen ====
Zeile 359: Zeile 365:
 Konfiguration prüfen: Konfiguration prüfen:
  
-<code bash>\\ +<code bash> 
-sudo /usr/bin/rsnapshot configtest\\ +sudo /usr/bin/rsnapshot configtest 
-echo $?\\+echo $? 
  
 </code> </code>
  
-Tagessicherung direkt starten:+Tagessicherung direkt starten: sudo/usr/bin/rsnapshot daily\ echo$?\
  
-<code bash>\\ +----
-sudo /usr/bin/rsnapshot daily\\ +
-echo $?\\+
  
-</code> 
- 
----- 
  
 ==== Mailversand testen ==== ==== Mailversand testen ====
Zeile 379: Zeile 381:
 Testmail senden: Testmail senden:
  
-<code bash>\\ +<code bash> 
-echo -e "Subject: Testmail\n\nDas ist ein Test." | sudo /usr/sbin/sendmail webmaster@waldhofer.com\\+echo -e "Subject: Testmail\n\nDas ist ein Test." | sudo /usr/sbin/sendmail webmaster@domain.at 
  
 </code> </code>
Zeile 387: Zeile 390:
  
 ---- ----
 +
  
 ==== Logdatei ==== ==== Logdatei ====
  
 Die Logdatei ist: Die Logdatei ist:
 +
 <code> <code>
-\\ +/var/log/rsnapshot_daily.log
-/var/log/rsnapshot_daily.log\\+
  
 </code> </code>
Zeile 405: Zeile 409:
  
 ---- ----
 +
  
 ==== Typische Fehlerquellen ==== ==== Typische Fehlerquellen ====
ubuntu/backup.1775983716.txt.gz · Zuletzt geändert: von franz

Falls nicht anders bezeichnet, ist der Inhalt dieses Wikis unter der folgenden Lizenz veröffentlicht: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki