From f6a8903a400674fbe12c7134cc7f304bc516e3a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Sch=C3=BCtte?= Date: Mon, 6 Nov 2017 13:21:35 +0100 Subject: [PATCH] Garbage collect scratch dir left-overs. (#573) --- jenkins/worker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jenkins/worker.py b/jenkins/worker.py index 0f84530..437685b 100644 --- a/jenkins/worker.py +++ b/jenkins/worker.py @@ -167,6 +167,10 @@ class Job(object): def run(self, ros_distro, run_id): """Runs the job with ROS distro 'ros_distro'.""" print 'running job {}'.format(self.id) + + # Garbage collect any left-overs from previous runs. + run_cmd('rm -rf /data/*') + # Copy the rosbag to scratch space scratch_dir = '/data/{}'.format(self.id) rosbag_filename = basename(self.rosbag)