Score:0

Fix auto-rerun of crontab script if it fails the first time

br flag

I want to re-run my script on crontab if it fails the first time. i know i can schedule one more time ín the cronjob but i want to write it on the script

Artur Meinild avatar
vn flag
What you're suggesting is not necessarily that simple. However, you could create a "wrapper" script, that will run another script over and over, until a certain condition is met. This could for instance be, that the other script creates a file or exports a variable when it is successful.
user535733 avatar
cn flag
The added logic and complexity suggests that cron may no longer be the best tool for your job. Time to migrate that job to a systemd service, which can optionally respawn upon failure.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.