vzdump omits /var/log

tog

Member
Jun 5, 2008
151
0
16
To test my vzdump-generated backups I took my latest backup from a couple of hours ago and restored it to a new CTID.

I shut down the good working CTID and started up the restored CTID (so I didn't have an IP conflict) and things were missing from the restored copy.

/var/log/postgresql was empty and had the wrong permissions so pgsql didn't start... when I fixed the permissions so it would start, I noticed that I simply had no pgsql database at all which should have been in /var/lib/postgresql/8.1/main.

This doesn't seem like a very useful backup, if I had a hardware failure and had relied on these vzdump backups I'd be screwed.
 
Ok, wait a minute, I restarted the restored CTID and postgres came up and I seem to have my data. I confirmed all the same stuff from /var/lib/vz/private/[goodctid] seemed to be there in /var/lib/vz/private/[restoredctid]

/var/log/* inside the VZ container seems to be the only thing missing from the restored CTID?
 
All right, I guess this is on purpose, so it's expected that I do not have anything from /var/log/*

From /usr/bin/vzdump:
Code:
find_add_exclude ('-files', '/var/log/.+');

Postgres started up once I fixed its log permissions and so did apache and the application inside the VZ container seems to work.
 
Some admin should change the title of this thread to "vzdump omits /var/log" so it's a little less alarming.
 
Done.

Omitting the logs usually saves much space, but maybe this should not be the default?

- Dietmar
 
I got wrong permissions at first because /var/log/* was omitted from the backup. The directory for postgres's logs is a subdirectory underneath /var/log/ which needs its permissions manually fixed when you first (re)create it so the postgres user can write to the directory.

IMHO, I think the omission of /var/log/* from the vzdump backups shouldn't be default, but is still of value should be turned into a command line option. There are some instances where some people might be expecting absolutely everything to be there when they restore and might actually have something in /var/log/ that was more important than normal, so they'd be unpleasantly surprised.
 

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!