-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from spitzlbergerj/development
Installationsskript fertiggestellt
- Loading branch information
Showing
14 changed files
with
1,253 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
# -------------------------------------------------- | ||
# Backup Skript fuer Raspberrys mit Config Dateien | ||
# (c) Josef Spitzlberger, 03.12.2022 | ||
# | ||
# 2. Skript fuer Sondersituationen in denen es nicht ausreicht, Dateien anzugeben | ||
# -------------------------------------------------- | ||
|
||
# -------------------------------------------------- | ||
# Parameter uebernehmen | ||
# -------------------------------------------------- | ||
|
||
BACKUP_DIR=$1 | ||
|
||
# -------------------------------------------------- | ||
# als 2. Skript melden | ||
# -------------------------------------------------- | ||
echo "----------------------------------------------------" | ||
echo " 2. Skript gestartet" | ||
echo "----------------------------------------------------" | ||
|
||
# -------------------------------------------------- | ||
# Sonderkommandos zum Sichern | ||
# -------------------------------------------------- | ||
|
||
# -------------------------------------------------- | ||
# MariaDB | ||
# -------------------------------------------------- | ||
|
||
# Maria DB | ||
|
||
# | ||
# Kommandos | ||
MYSQL_CMD=/usr/bin/mysql | ||
MYSQL_DMP=/usr/bin/mysqldump | ||
|
||
# Backup | ||
# | ||
echo | ||
echo "Starte Datenbanksicherung ..." | ||
mkdir -p "$BACKUP_DIR/MariaDB" | ||
databases=`$MYSQL_CMD -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema|performance_schema)"` | ||
|
||
for db in $databases; do | ||
echo "Sichere Datenbank $db ..." | ||
$MYSQL_DMP --no-data --databases "$db" > "$BACKUP_DIR/MariaDB/$db-schema.sql" | ||
$MYSQL_DMP --force --opt --databases "$db" | gzip > "$BACKUP_DIR/MariaDB/$db.gz" | ||
done | ||
|
||
# -------------------------------------------------- | ||
# 2. Skript beenden | ||
# -------------------------------------------------- | ||
echo "----------------------------------------------------" | ||
echo " 2. Skript abgeschlossen" | ||
echo "----------------------------------------------------" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/home/pi/CaravanPi/defaults | ||
/home/pi/MagicMirror/css/custom.css | ||
/home/pi/MagicMirror/config/config.js | ||
/usr/local/bin/pishutdown.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CaravanPiSSD | ||
15 | ||
LGBsharepoint | ||
Backup/Geraete/Raspberry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ACHTUNG: | ||
Damit die git hooks funktionieren müssen die beiden Dateien hier ins Verzeichnis .git/hooks kopiert werden. | ||
|
||
Außerdem muss ein Verzeichnis .git_sensible_backup angelegt werden | ||
|
||
Hier die Kommandos | ||
|
||
cd ~/CaravanPi | ||
cp .git_hooks/*commit .git/hooks | ||
chmod +x .git/hooks/*commit | ||
mkdir ~/CaravanPi/.git_sensible_backup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Unit] | ||
Description=Flask Webserver | ||
After=network.target | ||
|
||
[Service] | ||
User=pi | ||
WorkingDirectory=/home/pi/CaravanPi/html-flask | ||
ExecStart=/usr/bin/python3 -u /home/pi/CaravanPi/html-flask/flask-main.py | ||
Restart=always | ||
# Logdateien Umleitung, dabei unbuffered einschalten | ||
Environment=PYTHONUNBUFFERED=1 | ||
StandardOutput=append:/home/pi/CaravanPi/.log/flask-main.log | ||
StandardError=append:/home/pi/CaravanPi/.log/flask-main.log | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Bewegungsmelder | ||
After=network.target | ||
|
||
[Service] | ||
WorkingDirectory=/home/pi/CaravanPi/pir | ||
ExecStart=/usr/bin/python3 -u /home/pi/CaravanPi/pir/pir.py 120 1 | ||
Restart=always | ||
# Logdateien Umleitung, dabei unbuffered einschalten | ||
Environment=PYTHONUNBUFFERED=1 | ||
StandardOutput=append:/home/pi/CaravanPi/.log/pir.log | ||
StandardError=append:/home/pi/CaravanPi/.log/pir.log | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.