better temp folder control

This commit is contained in:
Llewellyn van der Merwe 2018-07-05 05:57:53 +02:00
parent 8e59f87023
commit 4d992b06fa
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
2 changed files with 6 additions and 5 deletions

View File

@ -75,6 +75,8 @@ function moveDB () {
}
function moveWEB () {
# we move to tmp folder
cd "$tmpFolder"
# local folder path
localFolder="$1"
# remote folder name
@ -94,9 +96,9 @@ function moveWEB () {
FILE="$2.zip"
fi
# zip the website
zip -r -q "${localFolder}${FILE}" "${localFolder}"
zip -r -q "${FILE}" "${localFolder}"
# set the paths
PaTh="${localFolder}${FILE}"
PaTh="${FILE}"
remotePaTh="${REMOTEWEBPATH}${FILE}"
else
# set the paths

View File

@ -25,6 +25,8 @@ function main () {
backupDB &
# backup the websites now
backupWEB
# now remove the local file
rmTmpFolder "$tmpFolder"
}
# function to backup all DB's
@ -37,9 +39,6 @@ function backupDB () {
# move to backup server
moveDB "$DBFILE"
done < $databaseBuilder
# now remove the local file
rmTmpFolder "$tmpFolder"
# start fresh
cd "$USERHOME"