summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Gonzalez <roger@rogs.me>2023-01-10 09:05:16 -0300
committerRoger Gonzalez <roger@rogs.me>2023-01-10 09:05:16 -0300
commit88707c12c91a164bb4fd6e09ece430a2b1c64b39 (patch)
tree1b14b9dd307036817de0076b14012f723450a701
parent4e11e0e8681d40328bba0f2b8494d1c8f194a4bb (diff)
Added create backup to yams
-rwxr-xr-xinstall.sh1
-rwxr-xr-xyams5
2 files changed, 6 insertions, 0 deletions
diff --git a/install.sh b/install.sh
index 0d85218..6dc169a 100755
--- a/install.sh
+++ b/install.sh
@@ -139,6 +139,7 @@ sed -i -e "s;<install_location>;$install_location;g" $filename
# Set yams script
sed -i -e "s;<filename>;$filename;g" yams
+sed -i -e "s;<install_location>;$install_location;g" yams
send_success_message "Everything installed correctly! 🎉"
diff --git a/yams b/yams
index 94ae558..1f109f7 100755
--- a/yams
+++ b/yams
@@ -2,6 +2,7 @@
set -eu
dc="docker-compose -f <filename>"
+install_location="<install_location>"
option=${1:-"--help"}
@@ -50,3 +51,7 @@ if [ $option == "destroy" ]; then
echo "\$ yams start"
fi
fi
+
+if [ $option == "create-backup" ]; then
+ tar -czf "$install_location/backups/yams-backup-$(date '+\%Y-\%m-\%d-\%s').tar.gz" $install_location/config/*
+fi