Cron does not accept concatenated commands

Hello,

What am I doing wrong here.

@reboot sleep 120

does run as expected, but even

@reboot sleep 120 && sleep 120

does not. Same if I put any else second command.

I also tried ";" in stead of "&&" with same result.

How can I make it work?

Try this:

@reboot { sleep 120 && sleep 120; }

Note the ; } at the end

1 Like

are you sure?
If i remember correctly busybox's crond does not know @reboot.
You can try /etc/rc.local

1 Like

putting reboot in rc.local is probably a very bad idea :slight_smile:

2 Likes

I ment putting the command which you will run on boot in /etc/rc.local...

1 Like

You are right. @reboot seems not to work at all. Even though it is documented.

Using rc.local sees to work.

Thanks everyone.

But also note the warning in the documentation below the table of shortcuts: