Results 1 to 7 of 7

Thread: Rsync --exclude rules for system backup

  1. #1
    Join Date
    Jun 2012
    Beans
    182

    Question Rsync --exclude rules for system backup

    I must admit,I thought this was going to be way easier:after backing up my system with a tar of my / directory with all the exclusions suggested here https://help.ubuntu.com/community/BackupYourSystem/TAR
    I was suggested that rsync also may be worth trying,so I had a go at backing up again with rsync trying to append the same exclusions as with tar,namely
    Code:
    /proc /sys /lost+found /mnt /media /dev
    well it apparently doesn't work the same way ,I keep getting some of these directories in the dry run test of rsync:can someone please point out what I'm doing wrong?
    Last edited by cogset; September 17th, 2012 at 04:25 PM.

  2. #2
    Join Date
    Nov 2008
    Location
    Sheffield, UK
    Beans
    1,517
    Distro
    Ubuntu

    Re: Rsync --exclude rules for system backup

    each folder needs the --exclude eg

    --exclude /proc --exclude /tmp



    take a look at back in time - its a good backup util

  3. #3
    Join Date
    Feb 2008
    Beans
    Hidden!

    Re: Rsync --exclude rules for system backup

    SlugSlug is correct, Here's a working example.
    Code:
    rsync -avz . /run/media/jj/Keepers --exclude ".cache/" --exclude "VirtualBox VMs/" --stats --delete
    HTH!


  4. #4
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Rsync --exclude rules for system backup

    FWIW, this question is answered on the Ubuntu wiki

    https://help.ubuntu.com/community/rsync
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  5. #5
    Join Date
    Apr 2006
    Location
    Ubuntuland
    Beans
    2,118
    Distro
    Ubuntu 13.10 Saucy Salamander

    Lightbulb Re: Rsync --exclude rules for system backup

    If you have a lot of exclusions, it's much better (and easier) to use the --exclude-from option and create a file that contains all of the exclusions.
    24 beers in a case, 24 hours in a day. Coincidence? I think not!

    Saucy Salamander 64 bit, AMD Phenom II 955 Quad Core 3.2GHz, GeForce 8300
    8G PC2-6400 RAM, 128 GB SSD, Twin 1TB SATA 7200 RPM RAID0

  6. #6
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Rsync --exclude rules for system backup

    Quote Originally Posted by slim odds View Post
    if you have a lot of exclusions, it's much better (and easier) to use the --exclude-from option and create a file that contains all of the exclusions.
    +1
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  7. #7
    Join Date
    Jun 2012
    Beans
    182

    Re: Rsync --exclude rules for system backup

    Thank you all for the replies (especially the tip about the --exclude-from option,very interesting):yes,I had a look at the wiki before asking but-as far as the exclude option goes-it doesn't look very accurate to me,as I've found no evidence of the quotation marks that are apparently needed to make it work.
    I kinda thought it was just the same as the --exclude option of tar,but there it works without quotes,in rsync I couldn't make it work.

    EDIT:later on,searching for useful tips,I've came across this line
    A lot of users do mistake when specifing path. This path should be relative to source directory
    in this webpage http://supportex.net/2011/07/excepti...rectory-rsync/ ,it may sound all too obvious but IMHO adding this simple remark to the wiki page would make things a lot easier for newbies like me.
    Last edited by cogset; September 20th, 2012 at 03:16 PM.

Tags for this Thread

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
  •