Add: post-backup hook Renamed:setup cms-handeler

Added funtion for runing script after Backup
Renamed bck-util cms-handeler to CMSHook-conf for future compatibility
This commit is contained in:
2021-02-10 12:03:10 +01:00
parent b3d293b8c3
commit 4e4f52bc1d
4 changed files with 8 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ DBPASS='<MSQLRootPW>' #MySQL Root password (syntax '<MSQLRoot
#RSYNC #RSYNC
RSPORT=22 #Rsync port RSPORT=22 #Rsync port
## To run a script after the backup has ran create "Post-backup-hook.sh" in this folder
##SiteBackup site backup command, multiple commands are allowed ##SiteBackup site backup command, multiple commands are allowed
#example: SiteBackup -d domain.com -sn domain -db wp_093 -sd "/var/www/domain.com/html" -ext-files "/ext/test.txt" -ai1 -wpupdate #example: SiteBackup -d domain.com -sn domain -db wp_093 -sd "/var/www/domain.com/html" -ext-files "/ext/test.txt" -ai1 -wpupdate
@@ -36,4 +37,3 @@ RSPORT=22 #Rsync port
# -srsync #syncs site folder via rsync # -srsync #syncs site folder via rsync
# -srsyncdel #also syncs deletes monthly (day set by DOMC) # -srsyncdel #also syncs deletes monthly (day set by DOMC)
# -tarenc #Enables encrypyed site Tar backup # -tarenc #Enables encrypyed site Tar backup

View File

@@ -199,3 +199,8 @@ fi
#Deletes Temp Folder #Deletes Temp Folder
echo "Clean UP" echo "Clean UP"
rm -r "$SENDDIR" && rm -r "$TMPDIR" rm -r "$SENDDIR" && rm -r "$TMPDIR"
#Check for after Backup hook script
if test -f "$ScriptLocation/Post-backup-hook.sh"; then
source "$ScriptLocation/Post-backup-hook.sh"
fi

View File

@@ -42,4 +42,4 @@ fi
if [ -z ${db_suffix+x} ]; then db_suffix=`expr $(ls -l /var/www | grep -c ^d) - 1`;fi if [ -z ${db_suffix+x} ]; then db_suffix=`expr $(ls -l /var/www | grep -c ^d) - 1`;fi
curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/config/Motd/51-bckupnotice -o /etc/update-motd.d/51-bckupnotice curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/config/Motd/51-bckupnotice -o /etc/update-motd.d/51-bckupnotice
chmod +x /etc/update-motd.d/51-bckupnotice chmod +x /etc/update-motd.d/51-bckupnotice
source <(curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/cms-handeler.sh) source <(curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/CMSHook-conf.sh)