Modify

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#12438 closed defect (wontfix)

Cron @reboot not working?

Reported by: anonymous Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

I have a script that I wish to invoke upon a reboot of the OpenWRT router. It works if I schedule every 2 minutes (*/2 * * * *) however, it does not work if I use the '@reboot' command (I want it to run once only upon a reboot).

Is the '@reboot' cron command supported in OpenWRT? I know other Linux versions support it, but unsure if it is a limitation of OpenWRT. If it cannot do it, how can I schedule a script to run upon a reboot?

Cron output shown below.

root@(none):~ $ cat /etc/crontabs/root
@reboot /etc/ssmtp/ssh-check.sh

Attachments (0)

Change History (4)

comment:1 Changed 4 years ago by anonymous

I don't know about that cron problem, but you can put startup commands in /etc/rc.local
Perhaps that can help you.

Just put

/etc/ssmtp/ssh-check.sh

in the rc.local file, but before the "exit 0" line.
Now it will run that script after every (re)boot.

comment:2 Changed 4 years ago by jow

  • Resolution set to wontfix
  • Status changed from new to closed

@reboot is an extension to the BSD crond, not supported by Busybox crond.

comment:3 Changed 4 years ago by anonymous

Guys, thank you so so much, I really appreicate it.

Anonymous - Putting it in /etc/rc.local works a charm, apologies for the noobness of my question.

Jow - Thanks for also clarifying that @reboot is not supported by Busybox.

You guys rock.

DJ

comment:4 Changed 3 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.