0

I am looking for way to configure cron to run multiple cron jobs that are located in a specified directory.

These cron jobs are self-destructive after one successful execution. I can't seem to find anything pertaining to what I am trying to do. This is an example cron job:

MAILTO=""
* * * * * root activation_script.sh  <name>  <version>

These cron jobs essentially run a script that activates <name> with a version. While I am able to run this script manually with the desired end result, there a multiple cron jobs that need to be automatically run, as these <name> should be activated by default.

Can anyone help me out with this?

HollowDev
  • 111
  • 1
  • 8
  • Would you care to show us your docker-compose.yml, or whatever you are using to stand up your service(s)? It all depends on which image you are using, and which cron implementation it provides, etc. More information will allow us to help you better. – Steve Storck Dec 01 '22 at 21:46
  • You realize that `* * * * *` will run that script every minute? – Nic3500 Dec 02 '22 at 16:07
  • You might [use `run-parts`](https://superuser.com/questions/402781/what-is-run-parts-in-etc-crontab-and-how-do-i-use-it). Also consider using a [`docker`-friendly `cron` implementation](https://stackoverflow.com/a/75353647/52499). – x-yuri Feb 05 '23 at 17:44

0 Answers0