I am trying to execute a script on server. When I do crontab -l
I get @reboot cd my_project_path; ./start.sh
on terminal.
However when I do @reboot cd my_project_path; ./start.sh
I get -bash: @reboot: command not found
. How do I include reboot command in bash? Sorry if this is a very basic question, but I am not master in bash.
There isn't a command @reboot
. I think you're looking for
shutdown -r now
or (possibly)
/sbin/reboot
which will reboot your machine. However, in crontab
a @reboot is a scheduled time, so that's the command it would run when your system has just rebooted... so perhaps you really just wanted
cd my_project_path; ./start.sh
@reboot in crontab means "Do that / execute that on server boot"
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