diff options
author | varac <varac@leap.se> | 2016-09-08 12:53:33 +0000 |
---|---|---|
committer | varac <varac@leap.se> | 2016-09-08 12:53:33 +0000 |
commit | cc4c01debe18293f9ae9643fb4ef6499d2277dac (patch) | |
tree | 81ee0721407a2f8fa44521a14d57984be37f7e07 | |
parent | 512e104b8249305ee3e34a283b9b5f94af795cd2 (diff) |
-rwxr-xr-x | remove_stale_vms | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/remove_stale_vms b/remove_stale_vms index dbcc159..74c63c0 100755 --- a/remove_stale_vms +++ b/remove_stale_vms @@ -1,9 +1,9 @@ -#!/bin/sh +#!/bin/bash # # removes all libvirt domains older than 1 day matching given regex -VM_REGEX='$test_' +VM_REGEX='test_' remove_domain () { echo "Destroying and undefining $vm" @@ -13,6 +13,7 @@ remove_domain () { for vm in $(find /etc/libvirt/qemu -maxdepth 1 -type f -mmin +1440 -exec basename -s .xml {} \;) do + #echo $vm [[ "$vm" =~ "$VM_REGEX" ]] && remove_domain $vm done |