Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Ich habe hier ein Backupskript und hab zwei Fragen dazu:

BACKUPZIEL="media/Extern/backup"

TIMESTAMP="timestamp.dat"

QUELLE="/var/lib/opsi /opt/pcbin/install /etc/opsi

DATUM="$(date +%d-%m-%Y)"

ZEIT="$(date +%H:%M)"

SICHERUNG=backup_`date +%Y%m%d`.tgz

cd /

mkdir -p ${BACKUPDIR}

if [ ! -d "${BACKUPDIR}"]; then

mail -s "Backupverzeichnis nicht vorhanden!" mail@mail.de <<EOM

Hallo Admin,

das BAckup am ${DATUM} konnte nicht erstellt werden. Das Verzeichnis ${BACKUPDIR} wurde nicht gefunden und konnte auch nicht angelegt werden.

EOM

. exit 1

fi

tar -czf ${BACKUPZIEL} /${SICHERUNG} -g ${BACKUPZIEL}/${TIMESTAMP} ${QUELLE}

if [ $? -ne 0]; then

mail -s "Backup ${QUELLE} war fehlerhaft!" <<EOM

Hallo Admin, das BAckup war fehlerhaft.

EOM

fi

Was bedeutet if [ ! -d ??????

Und was macht der Zusatzbefehl bei tar -g ????

Danke für Antworten

Und was bedeutet der Befehl

if [ $? -ne 0 ]

Und was bedeutet der Befehl

if [ $? -ne 0 ]

Laut meinem Buch über Shell - Programmierung enthält $? den letzten Rückgabestatus des zuvor ausgeführten Befehls. Und wenn der Rückgabewert ungleich 0 ist, dann ist anscheinend etwas schief gegangen.

Was bedeutet if [ ! -d ??????

Prüfung ob das Verzeichnis existiert. Hätte man auch selber drauf kommen können, wenn man sich die Fehlermeldung danach anschaut.

Und was macht der Zusatzbefehl bei tar -g ????

-g, --listed-incremental=FILE

handle new GNU-format incremental backup

Frank

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.