I have written a simple script that uses rsync to backup directories
to a USB drive. The directories are selected from an array. The
problem I am having is that if the directory has a space in it, the
script breaks.

I have tried putting backslashed in front of the spaces, and encasing
the entire path in single and double quotes. What am I doing wrong?

Here is the script:

#This is the list of files to backup
@source = qw(
        "/Users/joe/Documents/Palm/"
        "/Users/joe/Library/Application\ Support/AddressBook"
        "/Users/joe/Library/Application\ Support/iCal"
        "/Users/joe/Library/Mail"
);
$target = "/Volumes/TOSHIBA2/";
foreach(@source){
        system("rsync -a $_ $target");
}



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to