fix(Backup): folder name with space can be backed up

Backup function were not working with folders that had space on it.
Fixed now including double quotes with the parameter inside the
function.
This commit is contained in:
Bruno F. Fontes 2021-03-26 20:41:19 -03:00
parent e978b6a36e
commit 9b3515d121
Signed by: brunofontes
GPG Key ID: EE3447CE80048495

View File

@ -4,7 +4,7 @@ function backup () {
#--stats = show stats at end #--stats = show stats at end
#--progress = show each file being processed #--progress = show each file being processed
nice -n 19 borg create --compression auto,zstd,9 --exclude-from=./exclude $* nice -n 19 borg create --compression auto,zstd,9 --exclude-from=./exclude $1 "$2"
} }
function backupNoCompression () { function backupNoCompression () {
@ -13,7 +13,7 @@ function backupNoCompression () {
#--stats = show stats at end #--stats = show stats at end
#--progress = show each file being processed #--progress = show each file being processed
nice -n 19 borg create --compression none --exclude-from=./exclude $* nice -n 19 borg create --compression none --exclude-from=./exclude $1 "$2"
} }
function checkBackup() { function checkBackup() {
@ -110,7 +110,7 @@ backupNoCompression "$HDPath/Videos::$YEARMONTH" "/run/media/bruno/Multimedia/Vi
checkBackup "$HDPath/Videos/" checkBackup "$HDPath/Videos/"
echo -e "\e[97m`date +%r` - Copying Virtual Machines folder (7/7)...\e[39m" echo -e "\e[97m`date +%r` - Copying Virtual Machines folder (7/7)...\e[39m"
backup "$HDPath/VirtualMachines::$YEARMONTH" "/run/media/bruno/Multimedia/Virtual\ Machines" || echo "" backup "$HDPath/VirtualMachines::$YEARMONTH-2" "/run/media/bruno/Multimedia/Virtual Machines" || echo ""
checkBackup "$HDPath/VirtualMachines/" checkBackup "$HDPath/VirtualMachines/"
# Show result # Show result