From 5bbef83b8322bed914e6e7164cc4aaa177cfff34 Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 13 Jul 2020 20:13:47 +0530 Subject: [PATCH] Linux: delete `TEMP_CRON` file even if command fails --- .../post_breach/job_scheduling/linux_job_scheduling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/post_breach/job_scheduling/linux_job_scheduling.py b/monkey/infection_monkey/post_breach/job_scheduling/linux_job_scheduling.py index 8a4046c88..4ed5ff970 100644 --- a/monkey/infection_monkey/post_breach/job_scheduling/linux_job_scheduling.py +++ b/monkey/infection_monkey/post_breach/job_scheduling/linux_job_scheduling.py @@ -7,6 +7,6 @@ def get_linux_commands_to_schedule_jobs(): f'crontab -l > {TEMP_CRON} &&', 'echo \"# Successfully scheduled a job using crontab\" |', f'tee -a {TEMP_CRON} &&', - f'crontab {TEMP_CRON} &&', + f'crontab {TEMP_CRON} ;', f'rm {TEMP_CRON}' ]