I searched this website and Google but couldn't find it.. How can I execute two (or more) commands using @reboot ?

What I have now:

@reboot /root/website1/starter.sh

What I want:

@reboot /root/website1/starter.sh
@reboot /root/website2/starter.sh

Is this correct or should I solve it otherwise?

Thanks in advance :)

  • It would probably be helpful to know what distro of Unix/Linux you're using. In the meantime, you might try putting both commands in a shell script and simply invoking that script from \@reboot.
    – zpletan
    Dec 22, 2015 at 19:29
  • "Is this correct?" Does it work?
    – user
    Dec 22, 2015 at 19:55

1 Answer 1


Yes, that is the correct approach.

You could also reduce it to a single line, as such:

@reboot /root/website1/starter.sh && /root/website2/starter.sh

Just keep in mind that the scripts will run consecutively (not concurrently), and the second script will only run if the first script/command exits successfully. If the second script should run regardless of the result of the previous script, separate the commands with a semi-colon instead of &&.

If you need the scripts to run in parallel, you should stick with your original approach (one command/script on each line).

The double-ampersand (&&) can also be used in the "command" section to run multiple commands consecutively, but only if the previous command exits successfully. A string of commands joined by the double-ampersand will only get to the last command if all the previous commands are run successfully. If exit error-checking is not of a concern, string commands together, separated with a semi-colon (;)

CronHowto - Crontab Example

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .