Results 1 to 9 of 9

Thread: Backup a VPS?

  1. #1
    Join Date
    Oct 2011
    Location
    Canada
    Beans
    896
    Distro
    Ubuntu 12.04 Precise Pangolin

    Exclamation Backup a VPS?

    Hey guys, I have root access to a OpenVZ VPS running Ubuntu 11.04 (no GUI) and I am wondering about options to backup my data/system files? I'd like to backup ALL files and directories on my VPS into a single file (compressed preferably) and then download the file to my PC through FTP.

    Is that possible or any other recommendations?
    613websites.com Budget Canadian Web Design and Hosting

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Backup a VPS?

    Do you have ssh access? If you do, rsync might be a better idea.

    I believe you can tar the whole directory structure except for /dev and /proc
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Oct 2011
    Location
    Canada
    Beans
    896
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Backup a VPS?

    Quote Originally Posted by CharlesA View Post
    Do you have ssh access? If you do, rsync might be a better idea.

    I believe you can tar the whole directory structure except for /dev and /proc
    I do, but rsync seems mainly to be used to offload a backup to another server, not create a local copy (in a single file).
    613websites.com Budget Canadian Web Design and Hosting

  4. #4
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Backup a VPS?

    Tar would be the best option then.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  5. #5
    Join Date
    Nov 2007
    Location
    Newry, Northern Ireland
    Beans
    1,258

    Re: Backup a VPS?

    Quote Originally Posted by CharlesA View Post
    Tar would be the best option then.
    +1 and don't forget to gzip it too and if your local pc is a Linux desktop you can still initiate the rsync job from the local PC to copy it back.
    Can't think of anything profound or witty.
    My Blog: http://gonzothegeek.blogspot.co.uk/

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Backup a VPS?

    Quote Originally Posted by spynappels View Post
    +1 and don't forget to gzip it too and if your local pc is a Linux desktop you can still initiate the rsync job from the local PC to copy it back.
    Indeed. I'd go with either scp, sftp or rsync, with rsync being the ideal way to transfer the file.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  7. #7
    Join Date
    Sep 2006
    Beans
    7,356
    Distro
    Lubuntu Development Release

    tar

    Quote Originally Posted by CharlesA View Post
    Tar would be the best option then.
    You can run tar on the remote system and still save the results locally. Here is a simple example, yours will obviously have to be more complex to exclude various directories.

    Code:
    ssh d4m1r@vps.example.org "tar zcf - /var/www/" >  www-backup.tgz
    That will avoid the trouble of having a temporary tarball taking up space on the remote machine. That is especially relevant if you were going to back up the whole machine as you mentioned.

  8. #8
    Join Date
    Apr 2009
    Beans
    19

    Re: Backup a VPS?

    Rsync is your best option as only files that have changed (or have been deleted) will be sync'd. If you tar/zip the files, then the entire archive would have to be moved, which would be of significant size.

    I use rsync to give me a complete backup of each server. The initial backup takes awhile (6G of OS files and data), but once that has finished, it only takes a minute or less to replicate the changed data.

    Another similar option is rdiff-backup as you can get incremental backups (what did this file look like 2 weeks ago?). It automatically manages the increments and only replicates parts of files that have changed. You always have the equivalent of the latest rsync output at your destination, plus the addition of an 'rdiff-backup-data' directory that holds just the changes. If I screw something up, I can just use rsync from the backup to restore the file to the latest backup state. There are options for rdiff-backup to recover past versions of files/directories. Very nice!

    Hope this helps!

  9. #9
    Join Date
    Oct 2011
    Location
    Canada
    Beans
    896
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Backup a VPS?

    Quote Originally Posted by Irregular Joe View Post
    Rsync is your best option as only files that have changed (or have been deleted) will be sync'd. If you tar/zip the files, then the entire archive would have to be moved, which would be of significant size.

    I use rsync to give me a complete backup of each server. The initial backup takes awhile (6G of OS files and data), but once that has finished, it only takes a minute or less to replicate the changed data.

    Another similar option is rdiff-backup as you can get incremental backups (what did this file look like 2 weeks ago?). It automatically manages the increments and only replicates parts of files that have changed. You always have the equivalent of the latest rsync output at your destination, plus the addition of an 'rdiff-backup-data' directory that holds just the changes. If I screw something up, I can just use rsync from the backup to restore the file to the latest backup state. There are options for rdiff-backup to recover past versions of files/directories. Very nice!

    Hope this helps!
    I believe neither of those apply to OpenVZ containers, which are virtual environments. Also, when I made a complete backup of my VPS (found a shell script), the backup was only ~700MB.
    613websites.com Budget Canadian Web Design and Hosting

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
  •