diff --git a/launch.py b/launch.py index 87270f183c99c0fb8377eccddc80d84bbb318b91..d9c06489a98cc5258929fda1405be1d46dd9007f 100755 --- a/launch.py +++ b/launch.py @@ -970,8 +970,6 @@ if __name__ == '__main__': debug=options.debug, cpu_user_queue=options.cpu_user_queue) ss.tsleep_short = options.tsleep_short if options.crontab: - if not os.path.exists(os.path.join(os.getcwd(), 'launch_crontab.sh')): - write_crontab(every_min=options.every_min) if os.path.exists(ss.fname_config): ss.read_config() else: @@ -981,3 +979,7 @@ if __name__ == '__main__': ss.write_config() ss.init_state_log() ss(depend=options.depend, crontab_mode=options.crontab) + # start crontab job after first round of launching to prevent it from + # running more than once + if options.crontab: + write_crontab(every_min=options.every_min)