From 83fa9310b351dc2bc8e7224a898c9f999aee6b8d Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 13 May 2024 09:48:52 -0700 Subject: [PATCH] cron: add cleanup script --- scripts/cron-cleanup.sh | 7 +++++++ scripts/crontab-master | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 scripts/cron-cleanup.sh diff --git a/scripts/cron-cleanup.sh b/scripts/cron-cleanup.sh new file mode 100755 index 0000000..5ccb72a --- /dev/null +++ b/scripts/cron-cleanup.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Cleanup cron job run inside master container +set +e + +# Remove unused docker images +docker image prune -a -f diff --git a/scripts/crontab-master b/scripts/crontab-master index e33eee3..32c304a 100644 --- a/scripts/crontab-master +++ b/scripts/crontab-master @@ -1,4 +1,5 @@ # Cron jobs for master container */5 * * * * /bin/bash /testbed/scripts/cron-master.sh -*/8 * * * * /bin/bash /testbed/scripts/cron-status.sh \ No newline at end of file +*/8 * * * * /bin/bash /testbed/scripts/cron-status.sh +10 1 * * * /bin/bash /testbed/scripts/cron-cleanup.sh \ No newline at end of file