[Devel] [PATCH -E] scripts: add dump files save script

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu May 26 08:05:50 PDT 2016


This script can be added to vz-rst as action script and will save dump.log and
restore.log in format:

   dump-<DATE>-<time>.tgz

in /vz/private/<CTID>/dump directory.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 scripts/vz-save-dump.sh |   10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100755 scripts/vz-save-dump.sh

diff --git a/scripts/vz-save-dump.sh b/scripts/vz-save-dump.sh
new file mode 100755
index 0000000..830629c
--- /dev/null
+++ b/scripts/vz-save-dump.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+[[ "post-resume" == "$CRTOOLS_SCRIPT_ACTION" ]] || exit 0
+
+set -o pipefail
+
+dir="/vz/private/$VEID/dump"
+suffix=$(date +%F-%T)
+
+tar -C ${dir}/Dump/ -czf ${dir}/dump-$suffix.tgz dump.log restore.log > /dev/null



More information about the Devel mailing list