]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Adedd backup and reset script
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 25 Sep 2020 12:25:50 +0000 (14:25 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 25 Sep 2020 12:25:50 +0000 (14:25 +0200)
shell_scripts/backup.sh [new file with mode: 0755]
shell_scripts/reset.sh [new file with mode: 0755]

diff --git a/shell_scripts/backup.sh b/shell_scripts/backup.sh
new file mode 100755 (executable)
index 0000000..69839f0
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+FILENAME=homeassistant_$(date +"%Y%m%d").tar.bz2
+
+docker container stop homeassistant
+cd ../../
+tar cfvj homeassistant/backups/$FILENAME --exclude='backups' --exclude='tts/*' --exclude='home-assistant.log' --exclude='home-assistant_v2.db' homeassistant
+#docker container start homeassistant
+cd -
diff --git a/shell_scripts/reset.sh b/shell_scripts/reset.sh
new file mode 100755 (executable)
index 0000000..fbe8f01
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+docker container stop homeassistant
+docker container rm homeassistant
+cd ..
+sudo rm -fr \
+  .HA_VERSION \
+  .mercedesme-token-cache \
+  .storage \
+  .uuid \
+  custom_components \
+  deps \
+  home-assistant.log \
+  home-assistant_v2.db* \
+  html5_push_registrations.conf \
+  themes \
+  tts \
+  www/community 
+sudo cp -a git_repos/hacs/custom_components/hacs/ custom_components/
+docker-compose -f /srv/docker-compose/homeassistant/docker-compose.yaml up -d
+cd -