I created a script to enable flight mode at night and disable it in the morning. I'm adding checks to avoid enabling it if there is phone of web activities. The script has been added to cron (5 minute frequency to check, enable/disable every 5 minutes). It works well when the screen is up, tail on syslog shows perfect execution of the script. But, when the screen switches itself off, cron job is not run anymore. Maybe this is by design to save battery, but I guess it's possible to change it. Events like incoming call can switch the phone on, so I guess something is still running.
Any idea? Thanks