Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bash reboot command not found

Tags:

bash

shell

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.

like image 510
tech_human Avatar asked Dec 12 '14 22:12

tech_human


2 Answers

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
like image 69
Elliott Frisch Avatar answered Sep 17 '22 16:09

Elliott Frisch


@reboot in crontab means "Do that / execute that on server boot"

like image 38
DimiDak Avatar answered Sep 19 '22 16:09

DimiDak