Results 1 to 3 of 3

Thread: Rsync fails to create certain folders.

  1. #1
    Join Date
    Feb 2007
    Location
    Sebring, Florida USA
    Beans
    184

    Rsync fails to create certain folders.

    I am having a curious problem with an rsync script. Although I could opt to just back up my complete home folder, I choose to be selective and only backup what I would actually need if a hard drive disaster occurred. I am having difficulty backing up properly when I back up files in a subfolder but no files from the base folder the subfolder is under. Rsync refuses to create the base folder in the backup target partition and therefore will not create the subfolder and files either.

    Here's an example. It's my ".config" folder. There are a number of subfolders but I am only interested in backing up the "transmission" subfolder. My line for that in my script is this:

    Code:
    rsync -arv /home/trapper/.config/transmission/ /media/RSYNC-Backup/trapper/.config/transmission/
    When I run it I get this error message:

    Code:
    rsync: mkdir "/media/RSYNC-Backup/trapper/.config/transmission" failed: No such file or directory (2)
    rsync error: error in file IO (code 11) at main.c(595) [Receiver=3.0.7]
    rsync: connection unexpectedly closed (9 bytes received so far) [sender]
    rsync error: error in rsync protocol data stream (code 12) at io.c(601) [sender=3.0.7]
    However, this works and creates the .mozilla folder and it's entire contents, including subfolders & all subfolder files, at the backup target.

    Code:
    rsync -arv /home/trapper/.mozilla/ /media/RSYNC-Backup/trapper/.mozilla/
    Just to test, I added this to my script just prior to the transmission backup line:

    Code:
    if [ ! -d /media/RSYNC-Backup/trapper/.config ]
             then
    mkdir /media/RSYNC-Backup/trapper/.config
    fi
    The function above created the .config folder at the target and then the transmission folder backed up properly.


    I obviously have something wrong. What do I not know that I should know?
    Control is a wonderful thing ... but only if you have your own.
    LM13 with MATE DE on:
    BioStar MCP6P-M2 Motherboard * NVIDIA GeForce 6150/nForce 430 Video * AMD Sempron LE1100 1.9GHZ CPU * 2GB RAM * 160 GB SATA2 HD * 320 GB IDE HD

  2. #2
    Join Date
    Dec 2006
    Beans
    297

    Re: Rsync fails to create certain folders.

    I use rsync to backup the entire /home directory (including all users directories) - I'm no expert but I normally don't have problems.

    The 2 most obvious things I can think of:
    1) Permissions... cd into ~/.config and issue a ls -la and make sure the owner isn't root

    2) Is Transmission running while you attempt the backup? make sure it isn't by running killall transmission before trying to back up

  3. #3
    Join Date
    Feb 2007
    Location
    Sebring, Florida USA
    Beans
    184

    Re: Rsync fails to create certain folders.

    Quote Originally Posted by jondecker76 View Post
    I use rsync to backup the entire /home directory (including all users directories) - I'm no expert but I normally don't have problems.

    The 2 most obvious things I can think of:
    1) Permissions... cd into ~/.config and issue a ls -la and make sure the owner isn't root

    2) Is Transmission running while you attempt the backup? make sure it isn't by running killall transmission before trying to back up
    Thanks for this but in this instance it's not my problem. Just a few minutes ago I figured out what it is with the help of someone at Linux Forum.

    I need to use the --relative flag. Rather than rysnc -arv I should be using rysnc -arvR. That's going to give me:

    /media/RSYNC-Backup/home/trapper/"Whatever I am backing up in the script."


    In the specific case of:

    Code:
    rsync -arvR /home/trapper/.config/transmission/ /media/RSYNC-Backup/
    I get:

    /media/RSYNC-Backup/home/trapper/,config/transmission, with the transmission folder being the only subfolder backed up ... which is what I want.
    Control is a wonderful thing ... but only if you have your own.
    LM13 with MATE DE on:
    BioStar MCP6P-M2 Motherboard * NVIDIA GeForce 6150/nForce 430 Video * AMD Sempron LE1100 1.9GHZ CPU * 2GB RAM * 160 GB SATA2 HD * 320 GB IDE HD

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •