I've researched about this for today and I think one of the most commonly used solution is to create a simple shell script using bash while loop
For example if you want to create a cronjob that run every 5 seconds you can use this bash while loop:
$ cat every-5-seconds.sh #!/bin/bash while true do /home/ramesh/backup.sh sleep 5 donemy friend asked me a question, "how do to create a cron job that run every 79 mins?"
personally, i dont think the ordinary crontab can handle this...
btw, what i mean with 79 mins is cron that run at these times:
00:00
01:19
02:38
03:57
05:16
etc
based on above example you just need to change the value of 5 to 4740 (the numbers are in seconds)
you can create this shell script for job that run every 79 mins.
#!/bin/bash while(true) do echo "start script" java -jar /opt/cronUpdateExpiry.jar sleep 4740; done
That's it.
No comments:
Post a Comment