Need a one-time backup of two old messy Windows XP machines because of a company split. Using CentOS 6 x64 minimal install, i mounted some MS Windows NTFS harddrives installed locally via ntfs3g and over the LAN via smb. i need to self document what is backed up and thought there would be no better way than scripting everything done with rsync.
The problem is that almost all of the SOURCE folders have spaces in their name. The man page for rsync seems to indicate it supports only multiple source files, not multiple source folders. So i thought "easy enough", create a list and pass each source folder one-at-a-time to rsync.
SCRIPT:
SOURCEWITHSPACES=( "${PREFIX}/'Documents\ and\ Settings'/. ${PREFIX}/'electronic\ claims'/. ${PREFIX}/'billing\ statements'/." )
for P in ${SOURCEWITHSPACES[@]};
do echo $P;
done;
OUTPUT:
/media/4EC75/'Documents\ and\ Settings'/. /media/4EC75/'electronic\ claims'/. /media/4EC75/'billing\ statements'/.
So when this gets passed to rsync, it does not recognize any of the SOURCE folders. I do not want to glob because it needs to be clear exactly what was intended to be backed up. i also tried comma and colon separating the folder names, but that did not work either. What is the reliable way to handle this? Switch to perl or python? Please do not tell me to use robocopy.exe as i have used it for years and found it to differ so much between versions of windows, it is less reliable. Besides, i am never going back to Windows.
TAG=spacesinfolderfilenames
The shell script should be: