From 4d992b06fa2b6d5233dd425dc3d5a77580e75676 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 5 Jul 2018 05:57:53 +0200 Subject: [PATCH] better temp folder control --- incl.sh | 6 ++++-- main.sh | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/incl.sh b/incl.sh index 1b59427..a4832b4 100644 --- a/incl.sh +++ b/incl.sh @@ -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 diff --git a/main.sh b/main.sh index fc41c03..4f775ae 100644 --- a/main.sh +++ b/main.sh @@ -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"