cron

crontab

For performance, the file "crontab" uses single space as field separator. Letters are not suppored currently. So use "1" for "January" and 2 for "Tuesday" etc.

tcron

With the option "custom file handling" enabled, "default.rc" runs as shell script at uweb launching time and "default.rc2" runs whenever uweb becomes foreground.

Use tcron (Click to install) with "default.rc" or "default.rc2".

usage: tcron logfile command hours [timezone delay_sec elsecommand]
execute "command" during time interval once.
where logfile modification time must be updated if "command" runs successfully.

hours: If positive, then each day is divided into multiple intervals (unit: hour), and in each interval, the "command" runs only once.
If negative, then the unit is minute.
hours could be also in "hh:mm-hh:mm,..." format. Ex. "6:00-8:30,11:00-13:00,5:30-6:30".
timezone: an integer, default to be "8" for Beijing China (UTC+8). "0" for Greenwich UK (UTC+0).
delay_sec: execute "command" after "delay_sec" seconds.
elsecommand: executed whenever "command" not run.

ex:
set PATH=/system/bin:/data/data/info.torapp.uweb/files/bin
#Empty the folder "baidu" every 30 days.
tcron /sdcard/b "rm -rf /sdcard/baidu/*;toybox touch /sdcard/b" 720

Install example default.rc file for termux

Last Modified: 25 October 2023
add en/_posts/tcron.md