-1

I understand how to automate backups of websites via WHM/Cpanel. However, let's say I want to completely copy an entire VPS, so that I can cancel it, then easily deploy it again after a month or so. (This is different than just important files like described here: How to back up VPS)

I was thinking using cp to create an exact mirror of the system and downloading the copy and compressing. Or, try to FTP into the box and just download everything.

Is there an easy way to back up the entire Centos VPS? Your input is highly appreciated.

1 Answers1

0

After a couple days of trying a few different solutions. I have found 3 easy ways to back up your VPS in entirety.

  1. tar

The code I ended up using was:

tar -cpzf /backups/fullbackup.tar.gz --exclude=backups --exclude=proc --exclude=tmp --exclude=mnt --exclude=sys --exclude=dev --exclude=run /

This works to create a full back up of your vps system.

  1. dd

A good option for certain directories, but fair warning - it can give you a corrupted file because many logs are changing. See this post: How To dd or cp Entire Disk On Debian Remote Machine To Local Machine?

  1. rsync

This is pretty good on linux to linux. However, I had trouble allocating enough swap on MacOSx for this to work for me.

In the end, tar worked great. Of course, you can always get a snapshot from your VPS provider. However, they don't always offer you a download of the file and will charge you to store it. So, coping and downloading yourself is great.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232