1
0
mirror of https://github.com/Llewellynvdm/Backup-System.git synced 2024-12-12 17:07:46 +00:00

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

View File

@ -25,6 +25,8 @@ function main () {
backupDB & backupDB &
# backup the websites now # backup the websites now
backupWEB backupWEB
# now remove the local file
rmTmpFolder "$tmpFolder"
} }
# function to backup all DB's # function to backup all DB's
@ -38,9 +40,6 @@ function backupDB () {
moveDB "$DBFILE" moveDB "$DBFILE"
done < $databaseBuilder done < $databaseBuilder
# now remove the local file
rmTmpFolder "$tmpFolder"
# start fresh # start fresh
cd "$USERHOME" cd "$USERHOME"
# GO To remote server and do house cleaning # GO To remote server and do house cleaning