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

Thread: using rsync to backup system

  1. #1
    Join Date
    Jun 2011
    Beans
    304

    using rsync to backup system

    I am trying to use rsync to backup my system to external usb hard disk. There are 3 questions:

    1. Can I use rsync to backup running system or do I need to boot from livecd and then run rsync to copy hard disk system to external usb disk?

    2. Does the format of external usb hard disk need to be ext4 only or can I use fat32 or ntfs also?

    3. Is following command sufficient or any other option is needed and do I need a '/' after each folder name?

    Code:
    rsync -av --delete /media/ubuntu_hard_disk /media/ext_usb_disk
    Thanks for your help.

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,163
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: using rsync to backup system

    Hi rng.

    I would use rsync to backup personal data and configuration files, but it make less sense to me to use it to backup a booting partition. For that I would recommend taking a look at Clonezilla.

    Backing up to ext4 would preserve ownership and permissions, however ntfs will make it easy to access your data from almost any platform. I would avoid at all costs fat32.

    Just some thoughts.
    Regards.

  3. #3
    Join Date
    Nov 2010
    Location
    India
    Beans
    4,847
    Distro
    Ubuntu Development Release

    Re: using rsync to backup system

    Hi man use this link , it have complete rsync info

    https://help.ubuntu.com/community/rsync

    1...you can take backup from running system. no problem.
    2...i think any type format will be fine . no restrictions in that.
    Google First your issue , if no solution then ask.

    రాజ శేఖర్ రెడ్డి

  4. #4
    Join Date
    Jun 2011
    Beans
    304

    Re: using rsync to backup system

    I am keen to use rsync since it can update only changed files and would take less time. I think clonezilla will get the entire system every time.

    For running rsync from running system, the command should be (I think):

    Code:
    rsync -av --delete / /media/ext_usb_disk

  5. #5
    Join Date
    Jun 2011
    Beans
    304

    Re: using rsync to backup system

    Do I need to exclude /media /sys and /proc folders?

    rsync -auv --exclude='/media' --exclude='/proc' --exclude='/sys' / /media/backup-partition

  6. #6
    Join Date
    Sep 2006
    Beans
    8,179
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: using rsync to backup system

    Quote Originally Posted by rng View Post
    Do I need to exclude /media /sys and /proc folders?
    Also exclude /dev

  7. #7
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: using rsync to backup system

    You cannot copy to NTFS and preserve ownership and permissions as Windows does not support that. NTFS is ok for data, but not system. Use a Linux filesystem.

    Example script in post #20
    Originally Posted by MountainX View Post #20 also other backup apps
    http://ubuntuforums.org/showthread.p...ghlight=backup

    I plan on total reinstall, so I only backup configuration and data.
    Oldfred's list of stuff to backup May 2011:
    http://ubuntuforums.org/showthread.php?t=1748541
    For info on UEFI boot install & repair - Updated Mar 2015:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  8. #8
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    4,270
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: using rsync to backup system

    May I ask why you want to back up the entire system?

    To back up the entire system, as papibe said, use CloneZilla. It's fast and thorough.

    But I wouldn't bother, because if you totally break your system, it's quicker to reinstall especially if your /home is on a separate partition; if it's not, restore your entire /home folder after reinstalling.

    For backing up your data, I recommend looking at rdiff-backup. It uses rsync (so it's fast except for the very first time you back up), but it has the ability to keep previous versions, either indefinitely or for a set period; and you can fine-tune what is backed up. I back up my entire /home folder (for me and everyone else who uses the computer, so I use sudo) with rdiff-backup every day and it takes just 5-15 minutes depending on just how much has changed.

    Exclude the following folders when backing up:
    Code:
    /home/*/.cache
    /home/*/.dbus
    /home/*/.dropbox
    /home/*/.gvfs
    /home/*/.local/share/Trash
    /home/*/.mozilla/firefox/*.default/Cache/**
    /home/*/.qt
    /home/*/.thumbnails
    /home/*/Examples
    /home/.ecryptfs
    /home/lost+found
    And, of course, any others that you want excluded.
    Problems with WINE?
    Full Circle Magazine :: Confused "allot"? :: Cheap Linux stickers
    In my day, we had outdoors in which to run, play, and socialise. Now we have computers to do those.

  9. #9
    Join Date
    Jun 2011
    Beans
    304

    Re: using rsync to backup system

    1. I want to backup entire system because I have installed many programs and I will have to reinstall them as well if I do a fresh install.

    2. Regarding the folders that I exclude (/proc /sys etc) - will they be created automatically or do I manually create empty folders with the same name on backup partition.

    3. I want to confirm that I can use rsync to backup the system from within the running system- I do not need a livecd.
    Last edited by rng; November 30th, 2011 at 01:39 AM.

  10. #10
    Join Date
    Jul 2008
    Beans
    21

    Re: using rsync to backup system

    I have been using rsync to backup my servers (LAMP/Email) as well as my desktops for several years. No problem at all backing up a live file system and I have recovered from rsync backups multiple times without any issues both on servers, desktops and laptops.

    The syntax of my commands are something like this for my servers backing up to a second disk drive:

    rsync -vaHx --numeric-ids --delete / /backup_disk/rsync/

    or to backup my laptop to a USB device;

    rsync -vaHx --numeric-ids --exclude='/home/username/.gvfs' --delete / /media/USB_Device_Name/rsync_from_laptop/

    or to backup my laptop to another linux box:

    rsync --rsync-path "sudo rsync" -vaHx --numeric-ids --exclude='/home/username/.gvfs' --delete / -e ssh user@domain.tld:/backup_drive/rsync_from_laptop/

    Keep in mind that when you backup to another linux box that you must configure the /etc/sudoers file on the target backup machine for the command to work.

    I prefer to back up everything and then invoke most of my exclusions with my recovery command.

    FYI,

    Gordon
    Last edited by nodrog1952iii; November 30th, 2011 at 02:58 AM.

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
  •