Scheduled Tasks

Scheduled tasks are used to periodically execute scripts or other tasks. The usage of these scheduled tasks follows the standard Linux Crontab format. Apart from potentially different commands, the syntax is identical. All rules will be executed with root privileges. You need to be familiar with writing basic crontab rules. If you are not, please learn about them first.

Attention

Due to Android's doze mechanism, scheduled tasks may not run at the expected time when the screen is off. You may need to set your device's screen to stay on for the tasks to execute at the desired time.

You need to use this feature within FIRERPA's built-in Remote Desktop Terminal, ADB Terminal, or an SSH terminal. After entering the terminal, execute the command crontab -e to enter edit mode. Press the i key (in English input mode) to insert text, write your rules, and then press ESC, followed by SHIFT + :, type wq, and press Enter to save. Here are some example rules:

@reboot      echo Execute when the framework starts
0 */1 * * *  echo Execute every hour
* * * * *    echo Execute every minute
0 8 * * *    echo Execute at 8 AM every day

If you want to save the output of a scheduled task, you can use standard input/output redirection.

* * * * *    echo hello >/data/usr/script.log 2>&1

After writing your crontab rules, it is recommended to use a Crontab validation website to verify their accuracy.