mirror of
https://github.com/Llewellynvdm/Backup-System.git
synced 2024-12-12 08:57:47 +00:00
fixed timing delete tmp functions when tmp folder is still in use
This commit is contained in:
parent
000fff2528
commit
2a5660056a
21
main.sh
21
main.sh
@ -19,14 +19,16 @@
|
||||
#
|
||||
#/-----------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
#confirm we are done
|
||||
BACKUPDBDONE=0
|
||||
BACKUPWEBDONE=0
|
||||
|
||||
### MAIN ###
|
||||
function main () {
|
||||
# backup the databases now
|
||||
backupDB &
|
||||
# backup the websites now
|
||||
backupWEB
|
||||
# now remove the local file
|
||||
rmTmpFolder "$tmpFolder"
|
||||
}
|
||||
|
||||
# function to backup all DB's
|
||||
@ -46,6 +48,10 @@ function backupDB () {
|
||||
if [ "$BACKUPTYPE" -eq "1" ]; then
|
||||
ssh -tt -p '22' "$REMOTESSH" "$(typeset -f); remoteHouseCleaning $REMOTEDBPATH"
|
||||
fi
|
||||
#confirm we are done
|
||||
BACKUPDBDONE=1
|
||||
# try to remove tmp
|
||||
rmTmp
|
||||
}
|
||||
|
||||
# function to backup all WEB folders
|
||||
@ -65,6 +71,17 @@ function backupWEB () {
|
||||
if [ "$BACKUPTYPE" -eq "1" ]; then
|
||||
ssh -tt -p '22' "$REMOTESSH" "$(typeset -f); remoteHouseCleaning $REMOTEWEBPATH"
|
||||
fi
|
||||
#confirm we are done
|
||||
BACKUPWEBDONE=1
|
||||
# try to remove tmp
|
||||
rmTmp
|
||||
}
|
||||
|
||||
function rmTmp () {
|
||||
if [ "$BACKUPWEBDONE" -eq "1" ] && [ "$BACKUPDBDONE" -eq "1" ]; then
|
||||
# now remove the local file
|
||||
rmTmpFolder "$tmpFolder"
|
||||
fi
|
||||
}
|
||||
|
||||
# run the main only at the end!
|
||||
|
Loading…
Reference in New Issue
Block a user