[solved] Multiple scheduled actions at different times

'User made' tutorials related to Porteus Kiosk edition.
Official kiosk documentation can be find here: http://porteus-kiosk.org/documentation.html
Post Reply
kryptus
White ninja
White ninja
Posts: 4
Joined: 25 Apr 2017, 03:51
Distribution: Kiosk
Location: Canada

[solved] Multiple scheduled actions at different times

Post#1 by kryptus » 27 Oct 2017, 20:32

If I wanted to do 2 different things at 2 different times, for example restart the browser ar 5PM and reboot the PC at 4AM what would I put in scheduled_actions? I just thought I could write a script that checks the time - but is there a simpler way?
Last edited by kryptus on 31 Oct 2017, 21:01, edited 1 time in total.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4617
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Multiple scheduled actions at different times

Post#2 by fanthom » 28 Oct 2017, 07:06

You can use following syntax for the action:

Code: Select all

command1; sleep $x; command2; sleep $x; command3
Example:

Code: Select all

scheduled_action=Monday-10:00 Tuesday-10:00 Wednesday-10:00 Thursday-10:00 Friday-10:00 Saturday-10:00 Sunday-10:00 action:killall chrome; sleep 270m; killall chrome; sleep 4h; halt
If you need full cron functionality (different actions per day of month/year, etc) then you can inject cron jobs directly to the crontab using run_command parameter:

Code: Select all

run_command=echo '0 9 * * 1-5 root command' >> /etc/crontab; echo '0 10 * * SAT,SUN root command' >> /etc/crontab
Thanks
Please add [Solved] to your thread title if the solution was found.

Post Reply