Fw console question

Maybe more of a Linux question, but by googling is not yielding the result I am after.

Is there a Linux command to queue up a fw console reload command? For example if I wanted the command to run in 5 minutes, I could execute the command now and go about my business (type other commands, log out, etc.). 5 minutes later the command would execute.

Thanks for any insights.

You could use sleep for that.
sleep 5m && fwconsole reload

You can use:
s – seconds
m – minutes
h – hours
d – days

1 Like

You can also use the at command. The advantage is that it will survive a reboot, and has no trace of any connection with your console. A possible disadvantage is that I believe it will try to email you standard error, if not empty, and FreePBX doesn’t set up mail well for mail addressed to the local user.

E.g.

$ at now + 5 minutes
warning: commands will be executed using /bin/sh
at> echo > /dev/null
at> <EOT>
job 1 at Sat Jan 22 01:08:00 2022

<EOT> represents control-D.

You can specify quite complex times, which can be absolute and include a specific day of the week.

1 Like

I think the at command is actually what I want to use but it is not clicking for me after looking at the documentation. How would I write a dialplan line " in 5 minutes trigger fwconsole reload"?

exten => s,1,system()

As it uses standard input, you would have to use echo to pipe the actual command to it.

or use at's -f option to read commands from a file

Incase anyone needs this in the future, the working input is.

exten => s,n,System(echo “fwconsole reload” | at now + x minutes)

x is the number of minutes you want to delay before the command fires. This could be used asynchronously fire off other commands while the dial plan continues to execute or concludes.

Thanks all!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.