Hi, i would like to have the *.conf files available out of the tgz file.
In the past i tried modifying vzdump itself, and works, but of course that work is thrown away at each vzdump update, and my "patch" hasn't been incorporated in the standard pve
I think i can do a similar thing using the "hook script" feature of vzdump (--script)
i thought to make the script, in the "log-end" phase, to copy the <vmid>.conf file into the same dir where the .log and .tgz files are saved, with the same .tgz filename but with ".conf" appended (so to preserve its relation with a specific backup session).
i want to backup also this file, along with tgz and log, in order to be sure of the vm NAME, apart the ID, that is in the file i am restoring from. That would make me happier
i thought to add this in the example hook script i found in /usr/share/doc/vzdump/examples/hook-script.pl:
would that work?
is there any similar example?
do anybody use other methods?
how would behave the next day vzdump session? would it delete this file?
Thanks, Marco
In the past i tried modifying vzdump itself, and works, but of course that work is thrown away at each vzdump update, and my "patch" hasn't been incorporated in the standard pve
I think i can do a similar thing using the "hook script" feature of vzdump (--script)
i thought to make the script, in the "log-end" phase, to copy the <vmid>.conf file into the same dir where the .log and .tgz files are saved, with the same .tgz filename but with ".conf" appended (so to preserve its relation with a specific backup session).
i want to backup also this file, along with tgz and log, in order to be sure of the vm NAME, apart the ID, that is in the file i am restoring from. That would make me happier
i thought to add this in the example hook script i found in /usr/share/doc/vzdump/examples/hook-script.pl:
Code:
if ($phase eq 'log-end') {
if ($vmtype eq 'qemu') {
system ("cp /etc/qemu-server/$hostname.conf $dumpdir/$tarfile.conf ") == 0 ||
die "copy conf file to dumpdir failed";
} elsif ($vmtype eq 'openvz') {
system ("cp /etc/vz/conf/$hostname.conf $dumpdir/$tarfile.conf ") == 0 ||
die "copy conf file to dumpdir failed";
}
}
is there any similar example?
do anybody use other methods?
how would behave the next day vzdump session? would it delete this file?
Thanks, Marco