How to escape spaces in rsync source and destination paths
Yves PETRONIN
y.petronin at aliceadsl.fr
Fri Aug 22 14:58:18 GMT 2008
On OSX 10.4.11 , I am using this for instance and it seem there is
not problem with spaces in file names of Volume names.
I did have problems originally, but after addig double quotes
everywhere it worked fine.
folderSourceToBackup="/Users/"
VOLUMES="/Volumes/"
backupVolume=${VOLUMES}"${NOMVOLUME}"
exceptions="**/Caches/"
destination="/Sauvegardes_hebdomadaires/"
backupPath="${backupVolume}${destination}"
for i in ${folderSourceToBackup}*
do
USERNAME=$(basename ${i})
echo -n "[*]: Starting backup of user ${USERNAME} to ${backupPath}"
| logger
rsync -aEv --delete --exclude=${exceptions} --delete-excluded ${i} "$
{backupPath}" 2
done
More information about the rsync
mailing list