diff --git a/upgrade/All.sh b/upgrade/All.sh index 83d1278270790fd5d5c3bc7c675f75e1df3378f9..01761f63a9e308d760ab4d7b04560956cafed8a5 100644 --- a/upgrade/All.sh +++ b/upgrade/All.sh @@ -65,6 +65,8 @@ bash $DIR/install/ncdu.sh bash $DIR/upgrade/Monit.sh +bash $DIR/upgrade/Backups.sh + bash $DIR/checks/rkhunter.sh # Check docker is running @@ -80,8 +82,6 @@ services="$services $(systemctl | awk '/php.*fpm/{print $1}')" [ ! -z "$services" ] && systemctl restart $services checkrestart -bash $DIR/checks/backups.sh - echo -e "\tPlease check that the following services are up and running" bash $DIR/checks/list_domains.sh diff --git a/upgrade/Backups.sh b/upgrade/Backups.sh new file mode 100644 index 0000000000000000000000000000000000000000..04780e8b59e6350c6dc6e1faed2bc335033ca9a5 --- /dev/null +++ b/upgrade/Backups.sh @@ -0,0 +1,27 @@ +#!/bin/bash +echo "RUN $(basename "$0") ===" + +if [ ! -e $(dirname "$0")/../main.env ] +then + echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + exit 1 +else + echo "Environment file loaded" +fi +. $(dirname "$0")/../main.env + + +duplicity_dir="/opt/duplicity-ftp-backup/" +duplicity_alt_dir="/root/duplicity-ftp-backup/" +if [ -d "$duplicity_dir" ]; then + backup_dir="$duplicity_dir" +elif [ -d "$duplicity_alt_dir"]; then + backup_dir="$duplicity_alt_dir" +fi +if [ -z "$backup_dir" ]; then + echo "WARNING duplicity backup system not found" + exit 1 +fi +cd $backup_dir +git pull +bash $DIR/checks/backups.sh