Scheduled Tasks¶
Scheduled tasks are used to periodically execute scripts or other tasks. The usage method for these scheduled tasks follows the standard Linux Crontab usage method. Except for possibly different related commands, all other syntax is the same. All rules will be executed with root privileges. You need to know how to write basic crontab rules. If you are not familiar with them, please learn about them first.
Attention
Due to Android’s sleep mechanism, scheduled tasks may not run at the time you expect after the screen is turned off. You may need to set the device to stay on for scheduled tasks to execute at the time you expect.
You need to use this function in FIRERPA’s built-in remote desktop terminal, built-in ADB terminal, or SSH terminal. After entering the terminal, execute the command crontab -e
. You will enter edit mode. Press the letter i
in English input mode, then write the relevant rules, and press ESC
, SHIFT
+ :
, type wq
and press Enter to save. Some example rules are as follows:
@reboot echo Execute when the framework starts
0 */1 * * * echo Execute every hour
* * * * * echo Execute every minute
0 8 * * * echo Execute at 8 o'clock every day
If you want to save the output of scheduled tasks, you just need to perform normal input and output redirection:
* * * * * echo hello >/data/usr/script.log 2>&1
After writing the scheduled task rules, it is recommended to use a Crontab verification website to verify whether your rules are accurate.