Results 1 to 5 of 5

Thread: Backup with rsync the entire server

  1. #1
    Join Date
    Aug 2006
    Location
    Madrid (Spain)
    Beans
    160
    Distro
    Kubuntu 10.04 Lucid Lynx

    Question Backup with rsync the entire server

    Hi,

    I am trying to backup an entire server using rsync via ssh (remotely)
    I managed to backup using the root user (root@IP) but when I check the backed up user folders (/home/user) and other folders like /proc, they are empties.
    Is there any way to backup all the server including these and all the folders?

    Thanks.
    Best regards
    Last edited by Azathoth_; December 20th, 2011 at 07:01 PM.
    Software Libre, Ubuntu y mucho más en habla hispano en http://magarto.com/

  2. #2
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    /dev, /proc

    You don't want or need to transfer the contents of /dev or /proc

    http://manpages.ubuntu.com/manpages/...n7/hier.7.html

  3. #3
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,314
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Backup with rsync the entire server

    Presumably the /home/user directories contain actual files on the source machine?

    I run rsync on the target machine and suck down the remote filesystem, I put each backup into a separate directory with the name of the remote host.

    Code:
    cd /path/to/backups/remotehost
    sudo rsync -av root@remotehost:/ . --exclude-from=/path/to/backups/excludes --delete-excluded >> /var/log/backup
    The file /path/to/backups/excludes contains this list of file "globs"

    Code:
    proc/
    dev/
    sys/
    that are excluded from the transfer. As Lars observed, you don't want or need to back up directories like /proc.

  4. #4
    Join Date
    Feb 2006
    Location
    uk
    Beans
    Hidden!

    Re: Backup with rsync the entire server

    i suggest using similar flags as SeijiSensei uses (archive, verbose). perhaps also use the 'show progress' flag (P) and perhaps initially do a dry run (n) initially to see what's going on.

    Code:
    rsync -avPn source destination
    and use an exclude list too

    when you have the command right, remove the n so it actually does the transfer and not just a simulation, and then also remove the P and v flags when everything is correct, since these just report progress

  5. #5
    Join Date
    Aug 2006
    Location
    Madrid (Spain)
    Beans
    160
    Distro
    Kubuntu 10.04 Lucid Lynx

    Exclamation Re: Backup with rsync the entire server

    I have a incremental backup script and, summing up, it would be:

    Code:
    rsync -e "ssh" --force --ignore-errors --delete --delete-excluded \
     --exclude-from=$EXCLUDES --backup --backup-dir=$HOME/server-backup/`date +%Y-%m-%d` -avz root@"IP":/ $HOME/server-backup/main --log-file=$HOME/server-backup/log
    Just when I am writing this, I can see that the problem is that I am using -a rsync flag so it is backung up with owner and permissions so I have to write the script using root permissions, so I have to make a sudo...

    So, solved...
    Last edited by Azathoth_; December 21st, 2011 at 02:39 PM.
    Software Libre, Ubuntu y mucho más en habla hispano en http://magarto.com/

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
  •