beispiel verbesser
This commit is contained in:
parent
90a41c130c
commit
6c64d81204
12
17.html
12
17.html
@ -196,7 +196,17 @@ $ grep -i ^${k}a${k}e${k}i${k}o${k}u${k}$ /usr/share/dict/words</code></pre>
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
<p>zusätzliche Überlegungen:
|
||||||
|
<ul>
|
||||||
|
<li>gibt es bereits einen service der so heisst?</li>
|
||||||
|
<li>existiert die datenbank?</li>
|
||||||
|
<li>existieren die ordner?</li>
|
||||||
|
<li>existiert das backupziel?</li>
|
||||||
|
<li>was soll passieren wenn etwas nicht existiert?</li>
|
||||||
|
<li>was soll passieren wenn der upload scheitert?</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,16 @@
|
|||||||
# install script
|
# install script
|
||||||
|
|
||||||
|
# Inhalt von backup.service
|
||||||
|
# HERE Document https://ss64.com/bash/syntax-here.html
|
||||||
|
SERVICE=$(cat <<EOF
|
||||||
|
[Unit]
|
||||||
|
Description=Tägliches Wordpress Backup
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/bin/wp-backup.sh "$BACKUPFILE" "$BACKUPZIEL"
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
function dialog1 {
|
function dialog1 {
|
||||||
BACKUPFILE=$(whiptail --inputbox "Backup Dateiname ohne Endung " 8 78 Name --title "Dateiname" 3>&1 1>&2 2>&3)
|
BACKUPFILE=$(whiptail --inputbox "Backup Dateiname ohne Endung " 8 78 Name --title "Dateiname" 3>&1 1>&2 2>&3)
|
||||||
check_exit_status
|
check_exit_status
|
||||||
@ -19,28 +30,21 @@ function check_exit_status {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Inhalt von backup.service
|
|
||||||
function install_service {
|
function install_service {
|
||||||
|
cp wp-backup.sh /bin/ && \
|
||||||
# das HERE Document darf nicht eingerückt sein.
|
cp backup.timer /etc/systemd/system/ && \
|
||||||
SERVICE=$(cat <<EOF
|
echo "$SERVICE" > /etc/systemd/system/backup.service && \
|
||||||
[Unit]
|
systemctl enable --now backup.timer || fail
|
||||||
Description=Tägliches Wordpress Backup
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=/bin/wp-backup.sh "$BACKUPFILE" "$BACKUPZIEL"
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
|
|
||||||
cp wp-backup.sh /bin/
|
|
||||||
cp backup.timer /etc/systemd/system/
|
|
||||||
echo "$SERVICE" > /etc/systemd/system/backup.service
|
|
||||||
systemctl enable --now backup.timer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fail {
|
||||||
|
echo "Fehler!!"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
#funktions aufrufe
|
#funktions aufrufe
|
||||||
dialog1
|
dialog1
|
||||||
dialog2
|
dialog2
|
||||||
install_service
|
install_service
|
||||||
|
|
||||||
|
exit 0
|
@ -25,8 +25,6 @@ function upload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Funktionsaufrufe
|
# Funktionsaufrufe
|
||||||
dialog1
|
|
||||||
dialog2
|
|
||||||
db_backup
|
db_backup
|
||||||
file_backup
|
file_backup
|
||||||
upload
|
upload
|
Loading…
Reference in New Issue
Block a user