X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/blobdiff_plain/d320324f24300fbd1c9c63de4384e0e9047093c1..affb298cb15db064910b5d8b8f919c2f6e94bf8e:/host/usr/sbin/invirt-janitor?ds=inline diff --git a/host/usr/sbin/invirt-janitor b/host/usr/sbin/invirt-janitor index e631972..5d8f4ed 100755 --- a/host/usr/sbin/invirt-janitor +++ b/host/usr/sbin/invirt-janitor @@ -40,6 +40,14 @@ def cleanup(): lv_path = '/dev/xenvg/%s' % lv try: + # If the LV name doesn't start with old_, we probably + # don't actually want to be deleting it. + # + # Put it in the try block because we still want to delete + # the state file. + if not lv.startswith('old_'): + continue + syslog.syslog(syslog.LOG_INFO, "Cleaning up LV '%s'" % lv_path) # In a perfect world, this should be erroring out with @@ -47,6 +55,7 @@ def cleanup(): subprocess.call(['/usr/bin/ionice', '-c', '2', '-n', '7', + '/usr/bin/nice', '/bin/dd', 'if=/dev/zero', 'of=%s' % lv_path,