nathanhaigh / parallel-rsync

Parallelised rsync - using GNU parallel
MIT License
53 stars 5 forks source link

Don't works when source and destination contains space characters in their paths #13

Open MatteoGauthier opened 3 months ago

MatteoGauthier commented 3 months ago

Got issues when I tried using prsync using file paths with spaces in it like "/Volumes/SD Card"

Original command :

prsync -avhW --inplace --no-compress --progress --exclude='node_modules' /Volumes/SD-A\ 2023/Backup\ SD\ CARD\ Candice\ HDD\ Maxor\ 2TB\ Red\ Case/ /Volumes/Candice\ 2T/backup-fast

# Tested with this also
prsync -avhW --inplace --no-compress --progress --exclude='node_modules' \"/Volumes/SD-A 2023/Backup SD CARD Candice HDD Maxor 2TB Red Case\" \"/Volumes/Candice 2T/backup-fast\"

# And this
prsync -avhW --inplace --no-compress --progress --exclude='node_modules' \"/Volumes/SD-A 2023/Backup SD CARD Candice HDD Maxor 2TB Red Case\" \"/Volumes/Candice 2T/backup-fast\"
rsync --files-from=/var/folders/c8/g84x62xj5vjfd0vdh892yhb80000gn/T/tmp.6ozsPah7GM/chunk.6 -avhW --inplace --no-compress --progress --exclude=node_modules /Volumes/SD-A 2023/Backup SD CARD Candice HDD Maxor 2TB Red Case/ /Volumes/Candice 2T/backup-fast

# Return error code 1
# Rsync log the help command output
nathanhaigh commented 2 months ago

Ugh. My initial response is: don't use spaces in file paths as it's bad practice. However, I then have to remind myself that sometimes these things happen outside of our control. I'll try to take a look at making it handle whitespaces correctly.