I'm trying to run a bash script 10 minutes after my system startup and on every reboot. I was planning to the @reboot of crontab, but I'm not sure of two things
What expression would suit my situation the best? Please note that I can't run 'at' or system timer to accomplish this as both are not accessible to us. I'm working on the RHEL 7..
I would just sleep 600
at the beginning of your reboot script. Sure, there's probably a more "expert" way of doing it, but it'll work.
I think your question may be more appropriate on the Unix and Linux stack exchange, because I found two answers over there which directly address your question:
https://unix.stackexchange.com/questions/57852/crontab-job-start-1-min-after-reboot
Basically you can always just add sleep 600
to the beginning of your cronjob invocation.
As to whether you should be running a cronjob vs an init script:
https://unix.stackexchange.com/questions/188042/running-a-script-during-booting-startup-init-d-vs-cron-reboot
There are a handful of subtle differences, but basically, your cron @reboot will run each time the system starts and may be more easy to manage as a non-root user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With