I had a Shell Script that executes a Java Jar file. I wanted to know a Cron Expression such that, my shell script should execute immediately and the script should be started automatically, even after a system reboot. Is there any cron tag that lets me to do this ?
As Ernest has said, cron isn't about running a script immediately, it's about running a script on a schedule.
Modern Linux distros have an implementation called "anacron" that can ensure that if the system was down when the scheduled time passed that the missed script(s) will run once the system is back up again, but that's as close you you can get using cron.
Customer surveys are for companies who didn't pay proper attention to begin with.
Joined: Aug 22, 2010
Thanks Ernest/Tim for your responses.
Actually, according to the deployment standards in my company, I shuold come up with some Cron expression to my script such that, it should start after the deployment (not required to be done immeadiately but after an hour or 2 hours and the deployment time is fixed).
I can write some cron expression to start at a particular time. But what I want is that, my script should should be picked up automatically even after a system restart. Is it possible to get this done with a Cron tag ?