Menu ▾ ▴

#8 square brackets in file name makes rsync skip the file

open
nobody
None
5
2014-08-04
2004-10-08
No

I'm using flexbackup with rsync to backup a directory
into another disk.
If the source directory contains a file with square
bracket ('[' or ']') the file will be skipped during
backup and not saved.

I have fixed this problem changing line 1338 of
/usr/bin/flexbackup in:
# Have to take leading './' off to make rsync's
include/exclude work right
$cmd .= " | $::path{sed} -e \"s/\\.\\///g\" |
$::path{sed} -e \"s/\\[/\\\\[/g\" | sed -e
\"s/\\]/\\\\]/g\" | ";

(I used sed to escape the '[' and the ']' chars).
It works fine for me, but I think there shuold by some
other escaping problems with other characters.

Discussion

  • Mirko Montanari

    Mirko Montanari - 2004-10-08

    Logged In: YES
    user_id=725700

    sorry, few escape characters in fix.
    The correct line is:

    $cmd .= " | $::path{sed} -e \"s/\\.\\///g\" | $::path{sed}
    -e \"s/\\[/\\\\\\\\[/g\" | sed -e \"s/\\]/\\\\\\\\]/g\" | ";

     

Log in to post a comment.