mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
105 lines
4 KiB
HTML
105 lines
4 KiB
HTML
|
<!doctype html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
<link rel="stylesheet" href="../style.css" type="text/css" />
|
||
|
<title>cron</title>
|
||
|
<script type="text/javascript">
|
||
|
function findLang(){
|
||
|
let href = location.href;
|
||
|
for(let i=href.length-1;i>0;i--){
|
||
|
if('/'==href.charAt(i) && '/'==href.charAt(i-3))
|
||
|
return i;
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
function nav2(page){
|
||
|
let i = findLang();
|
||
|
location.href = location.href.substring(0,i+1)+page;
|
||
|
}
|
||
|
function nav2Lang(lang){
|
||
|
let i = findLang();
|
||
|
let href = location.href;
|
||
|
location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
|
||
|
}
|
||
|
</script>
|
||
|
</head>
|
||
|
<body>
|
||
|
<header class='header'>
|
||
|
<a class="logo" href="javascript:void(0)" onclick="return nav2('index.html')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html')">Tags</a>
|
||
|
|
||
|
|
||
|
<a class="logo" href="javascript:void(0)" onclick="return nav2Lang('zh')">简体中文</a>
|
||
|
|
||
|
|
||
|
<nav>
|
||
|
</nav>
|
||
|
</header>
|
||
|
<br />
|
||
|
|
||
|
<div class="container">
|
||
|
<h1 class="title">cron
|
||
|
<br>
|
||
|
<span class="subtitle"></span>
|
||
|
</h1>
|
||
|
<ul class="tags">
|
||
|
|
||
|
</ul>
|
||
|
<h4 id="crontab">crontab</h4>
|
||
|
<p>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.</p>
|
||
|
<h4 id="tcron">tcron</h4>
|
||
|
<p>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.</p>
|
||
|
<p>Use tcron (<a href="i:0bhttps://fastly.jsdelivr.net/gh/torappinfo/uwebjs/bin/tcron.tgz">Click to install</a>) with "default.rc" or "default.rc2".</p>
|
||
|
<p>usage: tcron logfile command hours [timezone delay_sec elsecommand]<br>
|
||
|
execute "command" during time interval once.<br>
|
||
|
where logfile modification time must be updated if "command" runs successfully.</p>
|
||
|
<p>hours: If positive, then each day is divided into multiple intervals (unit: hour), and in each interval, the "command" runs only once.<br>
|
||
|
If negative, then the unit is minute.<br>
|
||
|
hours could be also in "hh:mm-hh:mm,..." format. Ex. "6:00-8:30,11:00-13:00,5:30-6:30".<br>
|
||
|
timezone: an integer, default to be "8" for Beijing China (UTC+8). "0" for Greenwich UK (UTC+0).<br>
|
||
|
delay_sec: execute "command" after "delay_sec" seconds.<br>
|
||
|
elsecommand: executed whenever "command" not run.</p>
|
||
|
<p>ex:<br>
|
||
|
set PATH=/system/bin:/data/data/info.torapp.uweb/files/bin<br>
|
||
|
#Empty the folder "baidu" every 30 days.<br>
|
||
|
tcron /sdcard/b "rm -rf /sdcard/baidu/*;toybox touch /sdcard/b" 720</p>
|
||
|
<p><a target="_self" href="i:0hdefault.rc:../searchurl/txt/default.rc">Install example default.rc file for termux</a></p>
|
||
|
|
||
|
</div>
|
||
|
<p>Last Modified: 25 October 2023<br>
|
||
|
add en/_posts/tcron.md<br>
|
||
|
<pre></pre>
|
||
|
</p>
|
||
|
<script>
|
||
|
if(location.href.indexOf("/zh/")>0){
|
||
|
var script = document.createElement("script");
|
||
|
script.type = "text/javascript";
|
||
|
script.src = "../../js/gissues.js";
|
||
|
script.setAttribute("repo","jamesfengcao/uweb");
|
||
|
script.setAttribute("issue-term","title");
|
||
|
script.setAttribute("theme","github-light");
|
||
|
script.async = true;
|
||
|
document.body.appendChild(script);
|
||
|
}
|
||
|
</script>
|
||
|
<script id='jsgiscus'
|
||
|
src='https://giscus.app/client.js'
|
||
|
data-repo="torappinfo/uweb"
|
||
|
data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
|
||
|
data-category="Announcements"
|
||
|
data-category-id="DIC_kwDOEgNLGc4CQjsh"
|
||
|
data-mapping="title"
|
||
|
data-strict="0"
|
||
|
data-reactions-enabled="1"
|
||
|
data-emit-metadata="0"
|
||
|
data-input-position="top"
|
||
|
data-theme="light"
|
||
|
data-lang="en"
|
||
|
data-loading="lazy"
|
||
|
crossorigin="anonymous" async>
|
||
|
</script>
|
||
|
|
||
|
</body>
|
||
|
</html>
|