From cf52407520c4ff992a5726e9854433add1830228 Mon Sep 17 00:00:00 2001
From: Andreas Plach <andreas.plach@univie.ac.at>
Date: Tue, 16 Mar 2021 16:10:01 +0100
Subject: [PATCH] adding script to delete all ectrans jobs (shown with
 ecaccess-ectrans-list)

---
 clear_ectrans_list.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 clear_ectrans_list.py

diff --git a/clear_ectrans_list.py b/clear_ectrans_list.py
new file mode 100644
index 0000000..f29de8e
--- /dev/null
+++ b/clear_ectrans_list.py
@@ -0,0 +1,14 @@
+from subprocess import check_output, run
+
+# write output of ecaccess-ectrans-list to a variable, but transfer it
+# to a string (from bytes format) and split at newline
+out = str(check_output(['ecaccess-ectrans-list'])).split('\\n')
+
+for line in out:
+    line_tmp = line.split()
+    procID = line_tmp[0]
+    print(procID)
+    try:
+        run(['ecaccess-ectrans-delete', str(procID)])
+    except TypeError as e:
+        print(e)
-- 
GitLab