rsync can't make directory with whitespace

Discussion in 'macOS' started by sOid, Aug 8, 2009.

  1. sOid macrumors member

    Joined:
    Aug 8, 2009
    #1
    Hello all!

    I've got a bit of a problem here. I'm making an rsync script for my offsite storage hdd (encrypted with TrueCrypt).

    So far, it works like a charm. But when I try to back up a folder with a whitespace in it's name, for example "Application Support" it's starting to freak out.

    This is my rsync command:
    Code:
    rsync -a --progress --modify-window=1 ~/Library/Application\ Support/Little\ Snitch/ /Volumes/BACKUP/Library/Application\ Support/Little\ Snitch
    And I'm getting this error:
    Code:
    mkdir: /Volumes/BACKUP/Library/Application Support: No such file or directory
    Anyone knows why this doesn't work?

    The TrueCrypt volume is formatted as FAT32, but I don't think that would cause problems...
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    I'd use quotes instead to make sure it interprets the spaces correctly.

    Code:
    rsync -a --progress --modify-window=1 "~/Library/Application Support/Little Snitch/" "/Volumes/BACKUP/Library/Application Support/Little Snitch"
    You mention this is a part of a script, it's possible the script is doing something funny.
     
  3. sOid thread starter macrumors member

    Joined:
    Aug 8, 2009
    #3
    Thanks for your response!
    However, that isn't the solution.

    I figured out that the mkdir command (which rsync uses to create the folders) can only create one new folder by default. With the -p option set in the mkdir command, it can create several new folders.

    However, I don't know how to implement this in the rsync command...
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    Where did you get this information from? I've never had issues with rsync creating folders. I generally have it creating hundreds at a time.
     
  5. sOid thread starter macrumors member

    Joined:
    Aug 8, 2009
    #5
    Someone told me on another forum. He seems to be right so far...

    Any chance you've got the solution? :)
     
  6. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #6
    My rsync works great. Anyways, white space is not your problem, it could be an issue with the file system format of the drive being copied to and that you have a directory with all caps.

    From other forum:
     
  7. sOid thread starter macrumors member

    Joined:
    Aug 8, 2009
    #7
    Hmm yes, that might be it. However, it's still weird that rsync works great with a command like this.

    Code:
    rsync -a --progress --modify-window=1 ~/Library/Calendars/ /Volumes/BACKUP/Library/Calendars
    The only difference between this one and the previous one, is that this one has a 'smaller' structure and no folders with spaces in the name...

    I'm using ChronoSync now, but I would still like to use rsync.

    By the way, gonna try it with the destination set to an HFS+ formatted TrueCrypt volume. Back in a sec! ;)

    edit: nope, backing up to the HFS+ volume returns exactly the same error :(
     
  8. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #8
    Hmm, that is odd that the error persists. I use CCC for most of my regular backups and it's built off rsync and I have it backing up entire HD without an issue. There's likely some small thing interfering, but I'm sure what else to have you check. The only thing on your command that I haven't used is that "modify-window" piece, but from its description I don't see a reason for it to cause problems. The arguments I use are "-avz --progress." Well, and -e for remote backups of my web server.

    Good luck, and if you find the problem be sure to post back.
     
  9. sOid thread starter macrumors member

    Joined:
    Aug 8, 2009
    #9
    Thanks man, much appreciated.

    Don't really know what's the problem, but ChronoSync seems to do the job just fine. It's just that I don't really like having yet another piece of software running on the background...

    Also, I have to make two different 'scripts' in ChronoSync to do what I want. But that's only a small inconvenience.

    If I'll find the problem, I will certainly post it over here!
     

Share This Page