Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: [12.04] Error using rsync to backup...

Hybrid View

  1. #1
    Join Date
    Jan 2014
    Location
    Statham,GA USA
    Beans
    212
    Distro
    Ubuntu 12.04 Precise Pangolin

    [12.04] Error using rsync to backup...

    I am trying (and learning) to use rsync to back up my files (Everybody says "Back up before you do anything major.") Good advice. I am trying to back up my Home folder to a USB pendrive. I used the following:
    Code:
    rsync -vaxrPXhn /Home/ /<Destination>
    I did a -vv (very verbose) Dry Run and got this:
    Code:
    total: matches=0  hash_hits=0  false_alarms=0 data=0
    
    sent 135.68K bytes  received 12.83K bytes  99.00K bytes/sec
    total size is 171.68M  speedup is 1156.05 (DRY RUN)
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]
    ben@MissionControl:~$
    Error code 23 is "Partial transfer due to error."
    What have I done wrong here?
    I went by the rsync manpages> What did I miss?
    Last edited by bc.haynes; February 28th, 2014 at 05:32 AM. Reason: add info
    A to Z Answers to a lot of your questions....NewDocs.
    Book Download about 13.10.

  2. #2
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    5,739

    Re: [12.04] Error using rsync to backup...

    The error is probably because the flash drive is FAT formatted, and the permissions and ownership cannot be preserved. Remove options that preserve permissions or owner (such as the 'a' option) to prevent this.

  3. #3
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: [12.04] Error using rsync to backup...

    Hi again, bc.haynes.

    I suspect permission problems here.

    Where is the destination? Is it an external disk? your user has permissions to write there?
    If by any chance there's a file not owned by you on your home directory, rsync won't be able to create them with other owner than you.

    Use this command to find files that are not 100% owned by you:
    Code:
    find -not \( -user youruser -and -group youruser \) -exec ls -l '{}' \;
    Another alternative could be there are files that you own that don't have read permission to even you. Use this command to find them:
    Code:
    find -not -readable -exec ls -l '{}' \;
    This command will also find sym links to files that no longer exits.

    Another idea: there's no risk on removing the dry run option. If rsync fails, you just running again. The source remain untouch. Also, actually running it may print the exact files which are giving you trouble.

    Hope it helps. Let us know how if that helped.
    Regards.

    BTW: -a implies -r and -X, so you can just use -avxPhn

  4. #4
    Join Date
    Jan 2014
    Location
    Statham,GA USA
    Beans
    212
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: [12.04] Error using rsync to backup...

    I am the root user. The pendrive should be ext4....will check.
    A to Z Answers to a lot of your questions....NewDocs.
    Book Download about 13.10.

  5. #5
    Join Date
    Jan 2014
    Location
    Statham,GA USA
    Beans
    212
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: [12.04] Error using rsync to backup...

    I checked and the pendrives are formatted ext4. I used two pendrives. I did this with the first:
    Code:
    sudo rsync -varxPzh /source/ /destination
    It returned the same error as before.
    The second pendrive I did this:
    Code:
    sudo rsync -vrxWPXh /source/ /destination
    and got the same error again. See error below:
    Code:
    total: matches=0  hash_hits=0  false_alarms=0 data=173483430
    
    sent 75.43M bytes  received 59.53K bytes  10.06M bytes/sec
    total size is 173.48M  speedup is 2.30
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]
    Can't figure this one out.
    Any more ideas?
    A to Z Answers to a lot of your questions....NewDocs.
    Book Download about 13.10.

  6. #6
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: [12.04] Error using rsync to backup...

    I suggest that you start with something simple, and make it work. Then make it more complicated step by step until you have a complete backup script.

    Change the ownership and permissions of the partition on the pendrive until it works.

    For example:

    1. Copy a file to the pendrive with the file browser.
    2. Copy a directory (with some files) with the file browser.
    3. Copy a file to the pendrive with cp file target
    4. Copy a file to the pendrive with cp -p file target # preserving the permissions
    5. Copy a directory (with some files) with cp -r directory target
    6. Copy a directory (with some files) with cp -pr directory target # preserving the permissions
    7. Copy a directory (with some files) with cp -av directory target # preserving the permissions
    9. Copy a directory (with some files) with rsync -av directory target
    ...

    Notice the difference between rsync -av directory target and rsync -av directory/ target

    See
    Code:
    man cp
    and
    Code:
    man rsync
    for more details about the command options.

  7. #7
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    5,739

    Re: [12.04] Error using rsync to backup...

    Can't figure this one out.
    Any more ideas?
    1) I would not use sudo with rsync. The man page states it is not needed, so I would try without sudo to see if that is part of the problem. My rsync commands don't use it.
    2) If all your files are regular files or directories from your home directory, then options -rtui should be enough to back them up and also show what is being copied.

    Also, you should know that the source can be multiple sources:

    If D1, D2, D3, are three folders you want backed up,

    rsync D1 D2 D3 D4

    will back them up to D4.

    D1/ will send the contents of D1 and not the folder itself.

  8. #8
    Join Date
    Jan 2014
    Location
    Statham,GA USA
    Beans
    212
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: [12.04] Error using rsync to backup...

    @ sudodus +1 - Thank you for the exercises....and they were good ones. I learned a lot. Like "Keep it simple!"
    A to Z Answers to a lot of your questions....NewDocs.
    Book Download about 13.10.

  9. #9
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: [12.04] Error using rsync to backup...

    You are welcome

  10. #10
    Join Date
    Jan 2014
    Location
    Statham,GA USA
    Beans
    212
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: [12.04] Error using rsync to backup...

    @ Dennis N - I had no problem with sudodus' rsync -av Source/ Destination, just backing up one folder, but it does not work for a real backup because I get a "Permission Denied" on all of the .hidden files. I tried both
    Code:
    rsync -av Source/ /Destination
    And
    Code:
    rsync -rtui Source/ /Destination
    And I get this error:
    Code:
    rsync: send_files failed to open "/home/minion/.pulse-cookie": Permission denied (13)
    rsync: send_files failed to open "/home/minion/.xsession-errors": Permission denied (13)
    
    sent 227913 bytes  received 4803 bytes  465432.00 bytes/sec
    total size is 182169865  speedup is 782.80
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]
    ben@MissionControl:/$
    What's wrong?
    A to Z Answers to a lot of your questions....NewDocs.
    Book Download about 13.10.

Page 1 of 3 123 LastLast

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
  •