Online backup of Proxmox host

acidrop

Renowned Member
Jul 17, 2012
204
6
83
Hello

I'm using a single server installation of proxmox ve 2.2 with just one vm on a local disk storage.
I can backup vm without problems on an external NFS storage regularly.
What I need is to be able to take an online image of the host machine (just like Acronis).
I read about Clonezilla but it does not support online imaging.
Is there another solution to achieve this?
 
we look at systems like Proxmox and pfSense as something to just reinstall and copy over a few backed up files.

for Proxmox we use rsnapshot local and remote backups . it the system needs to be rebuilt , re install and copy over the parts of /etc you've customized.

this is what we backup on all pve system to all other:
Code:
backup  /root/.ssh/             localhost/
backup  /etc/           localhost/
backup  /etc/pve/               localhost/
backup  /var/spool/cron/crontabs/       localhost/

 backup  root@s008:/etc/         s008/backup  root@s008:/etc/pve/     s008/


backup  root@fbc241:/etc/       fbc241/
backup  root@fbc241:/etc/pve/   fbc241/


backup  root@fbc243:/etc/       fbc243/
backup  root@fbc243:/etc/pve/   fbc243/



from the rsyanshot man page:
Code:
rsnapshot is a filesystem snapshot utility. It can take incremental snapshots of local and remote filesystems for any number of machines.


       Local filesystem snapshots are handled with rsync(1). Secure remote connections are handled with rsync over ssh(1), while anonymous rsync
       connections simply use an rsync server. Both remote and local transfers depend on rsync.


       rsnapshot saves much more disk space than you might imagine. The amount of space required is roughly the size of one full backup, plus a
       copy of each additional file that is changed. rsnapshot makes extensive use of hard links, so if the file doesn't change, the next
       snapshot is simply a hard link to the exact same file.


       rsnapshot will typically be invoked as root by a cron job, or series of cron jobs. It is possible, however, to run as any arbitrary user
       with an alternate configuration file.

if you want help on the initial set up just reply.
 
  • Like
Reactions: mjw
Thank you for your reply.

So, as I understand it is not necessary to take a full backup of the server but just only the config files and some other critical files.
Does rsnapshot take backup of locked files also or I must stop some services first before invoking the command?

I will try it and report back for any problems.
Thank you very much.
 
here are a couple of usage notes:

tabs are needed to separate parts of a line in rsnapshot.conf

here is our crontab. note that a sleep is used before running the 1-st backup. otherwise our cluster would sometimes get communication issues. the sleep helps prevent the rsync job from running at the same time from multiple systems.
Code:
33 6    * * *   root    /usr/local/bin/sleep-1800 ; ionice -c 3  /usr/bin/rsnapshot  -c /etc/fantini/rsnapshot/rsnapshot-pve-host.conf  daily


0  3    * * 1   root    /usr/bin/rsnapshot       -c /etc/fantini/rsnapshot/rsnapshot-pve-host.conf  weekly
30 2    1 * *   root    /usr/bin/rsnapshot       -c /etc/fantini/rsnapshot/rsnapshot-pve-host.conf  monthly

here is the sleep script:
Code:
#!/bin/sh
# sleep-1800


# seconds
RANGE=1800
number=`od -vAn -N2 -tu4 < /dev/urandom`
number=`expr $number "%" $RANGE`


# sleep only if not called from cli
tty > /dev/null || sleep $number

here is what the backups look like:
Code:
fbc241  /rsnapshot # ls daily.0/*
daily.0/fbc1:
etc


daily.0/fbc100:
etc


daily.0/fbc241:
etc


daily.0/fbc243:
etc


daily.0/fbc73:
etc


daily.0/localhost:
etc  fbc  root  var


daily.0/s008:
etc
fbc241  /rsnapshot # ls -ld  daily.0/*/etc/pve
drwxr-x--- 4 root www-data 4096 Dec 31  1969 daily.0/fbc100/etc/pve
drwxr-x--- 5 root www-data 4096 Dec 31  1969 daily.0/fbc1/etc/pve
drwxr-x--- 4 root www-data 4096 Dec 31  1969 daily.0/fbc241/etc/pve
drwxr-x--- 4 root www-data 4096 Dec 31  1969 daily.0/fbc243/etc/pve
drwxr-x--- 4 root www-data 4096 Dec 31  1969 daily.0/fbc73/etc/pve
drwxr-x--- 4 root www-data 4096 Dec 31  1969 daily.0/localhost/etc/pve
drwxr-x--- 4 root www-data 4096 Dec 31  1969 daily.0/s008/etc/pve
fbc241  /rsnapshot # ls -ld  daily.0/*/etc/hosts
-rw-r--r-- 14 root root 62109 Sep 15 15:02 daily.0/fbc100/etc/hosts
-rw-r--r--  8 root root 74529 Jan 10 15:30 daily.0/fbc1/etc/hosts
-rw-r--r--  8 root root 74583 Jan 10 15:32 daily.0/fbc241/etc/hosts
-rw-r--r--  7 root root  1530 Jan 16 09:47 daily.0/fbc243/etc/hosts
-rw-r--r--  8 root root 79454 Jan 10 15:53 daily.0/fbc73/etc/hosts
-rw-r--r--  8 root root 74583 Jan 10 15:32 daily.0/localhost/etc/hosts
-rw-r--r--  8 root root 79395 Jan 10 14:32 daily.0/s008/etc/hosts
fbc241  /rsnapshot # ls -ld  */fbc73/etc/hosts
-rw-r--r-- 8 root root 79454 Jan 10 15:53 daily.0/fbc73/etc/hosts
-rw-r--r-- 8 root root 79454 Jan 10 15:53 daily.1/fbc73/etc/hosts
-rw-r--r-- 8 root root 79454 Jan 10 15:53 daily.2/fbc73/etc/hosts
-rw-r--r-- 8 root root 79454 Jan 10 15:53 daily.3/fbc73/etc/hosts
-rw-r--r-- 8 root root 79454 Jan 10 15:53 daily.4/fbc73/etc/hosts
-rw-r--r-- 8 root root 79454 Jan 10 15:53 daily.5/fbc73/etc/hosts
-rw-r--r-- 8 root root 79454 Jan 10 15:53 daily.6/fbc73/etc/hosts
-rw-r--r-- 1 root root 74710 Dec  1 19:00 monthly.0/fbc73/etc/hosts
-rw-r--r-- 1 root root 62248 Oct 24 12:17 monthly.1/fbc73/etc/hosts
-rw-r--r-- 1 root root 62153 Sep 21 11:30 monthly.2/fbc73/etc/hosts
-rw-r--r-- 8 root root 79454 Jan 10 15:53 weekly.0/fbc73/etc/hosts
-rw-r--r-- 1 root root 74774 Jan  5 17:46 weekly.1/fbc73/etc/hosts
-rw-r--r-- 1 root root 74740 Dec 27 14:30 weekly.2/fbc73/etc/hosts
-rw-r--r-- 1 root root 74657 Dec 20 20:02 weekly.3/fbc73/etc/hosts
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!