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:
parent
8e59f87023
commit
4d992b06fa
6
incl.sh
6
incl.sh
@ -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
|
||||||
|
5
main.sh
5
main.sh
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user