CRON tasks question : Newb tries to launch simple project RPi4+BalenaOS/Cloud+Screenly

Hey @pesant

Bienvenue :slight_smile: !

  1. Regarding setting the timezone in your application container, you can set a service variable TZ with the desired value.
  2. As for setting up the cron job, you can possible achieve this with a cron task itself. Iā€™m not sure how (and why) you would want to do it with celery?

You can find an example of a scheduler service here. In the example it switches on/off the backlight on a PiDisplay. You would have to use the respective commands you specified

I hope this helps. Let us know

Hi @rahul-thakoor!
Thanx to welcome me! :slight_smile:

Regarding setting the timezone in your application container, you can set a service variable TZ with the desired value.

Yep, I get it, saw it by myslef few days ago and related to that post below, another expert like you confimed too few hours after I changed my configuration.

Concerning cron task, cron doesnā€™t work for me and because of that :

(at the end of discussion, specially from vpertesson)

So, thank you to re-open reflections about it and considering that possibilityā€¦
I have to try and adapt the code below to my wishes:

#!/bin/bash

if [ ! -z ${ENABLE_BACKLIGHT_TIMER+x} ] && [ "$ENABLE_BACKLIGHT_TIMER" -eq "1" ]

then

  (crontab -l; echo "${BACKLIGHT_ON:-0 8 * * *} /usr/src/backlight_on.sh") | crontab -

  (crontab -l; echo "${BACKLIGHT_OFF:-0 23 * * *} /usr/src/backlight_off.sh") | crontab -

fi

crond -f

I also saw that too:

Could you send me a simple procedure to make it?

1/ create my own scheduler script with vsCode, Atom etcā€¦
a) start.sh ā† cron job
b) hdmi_standby.sh ā† CEC-CLIENT bash command
c) hdmi_on.sh

2/ push it on my device with Balena-CLI

Do I have to have another container docker as scheduler in your example or I have to modify an actual one (srly-*)?

Thank you very much!