Browse Source

Script for extract VM restore state from PVE

pmacko 1 month ago
parent
commit
c1a9d31d17
1 changed files with 21 additions and 0 deletions
  1. 21 0
      pve_restore.sh

+ 21 - 0
pve_restore.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+#########################################################################
+#                Script for extract PVE restore VM status               #
+#                           Created by PM-DoIT                          #
+#                                 ver 0.1                               #
+#########################################################################
+clear
+SRV=$(hostname -s)
+echo -e "\e[1;32mSUMMARY\e[0m of ALL PVE VM \e[1;35mrestore\e[0m from \e[1;33m$SRV\e[0m"
+test -f /tmp/pver && rm -rf /tmp/pver
+echo "--- --------- ------------ ------------" > /tmp/pver.log
+echo "PID HOSTNAME RESTORE-DATE RESTORE-TIME" >> /tmp/pver.log
+echo "--- --------- ------------ ------------" >> /tmp/pver.log
+LSR=$(egrep -lRi "restore" /var/log/pve/tasks/* | grep pam)
+for r in $LSR;
+do
+ls -laF $r | sed 's/\:/ /g'  | awk '{print $16,$11,$7"-"$6,$8":"$9}' >> /tmp/pver
+done
+test -f /tmp/pver && cat /tmp/pver | sort -n >> /tmp/pver.log
+echo "--- --------- ------------ ------------" >> /tmp/pver.log
+cat /tmp/pver.log | column -t