[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
Forum rules
Porteus Kiosk section of the forum is unmaintained now. Its kept in a 'read only' mode for archival purposes.
Please use the kiosk contact page for directing your queries: https://porteus-kiosk.org/contact.html
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
Moderator Team
Moderator Team
Posts: 5667
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
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.

Locked