add crontab support as alarm clock

This commit is contained in:
James Feng Cao 2023-10-25 13:09:25 +08:00
parent 1fb143ab1b
commit 8c6754186c
11 changed files with 160 additions and 13 deletions

View File

@ -6,7 +6,20 @@
<description>Recent content in _posts on uweb browser: unlimited power</description>
<generator>Hugo -- gohugo.io</generator>
<language>en</language>
<lastBuildDate>Tue, 11 Apr 2023 00:00:00 +0000</lastBuildDate><atom:link href="/en/_posts/index.xml" rel="self" type="application/rss+xml" />
<lastBuildDate>Wed, 25 Oct 2023 00:00:00 +0000</lastBuildDate><atom:link href="/en/_posts/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>cron</title>
<link>/en/tcron/</link>
<pubDate>Wed, 25 Oct 2023 00:00:00 +0000</pubDate>
<guid>/en/tcron/</guid>
<description>crontab For performance, the file &amp;quot;crontab&amp;quot; uses single space as field separator. Letters are not suppored currently. So use &amp;quot;1&amp;quot; for &amp;quot;January&amp;quot; and 2 for &amp;quot;Tuesday&amp;quot; etc.
tcron With the option &amp;quot;custom file handling&amp;quot; enabled, &amp;quot;default.rc&amp;quot; runs as shell script at uweb launching time and &amp;quot;default.rc2&amp;quot; runs whenever uweb becomes foreground.
Use tcron (Click to install) with &amp;quot;default.rc&amp;quot; or &amp;quot;default.rc2&amp;quot;.
usage: tcron logfile command hours [timezone delay_sec elsecommand]
execute &amp;quot;command&amp;quot; during time interval once.</description>
</item>
<item>
<title>Offline resources</title>
<link>/en/offlinecache/</link>

View File

@ -77,6 +77,7 @@
&quot;<a href="file:///data/data/info.torapp.uweb/files/default.filecap">default.filecap</a>&quot;:<a href="../filecap/index.html">custom file handling</a><br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/default.rc">default.rc</a>&quot;: check the option &quot;custom file handling&quot; to execute the shell script file during uweb launching. <a href="../tools/index.html">tcron</a> provides extra cron tools.<br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/default.rc2">default.rc2</a>&quot;: check the option &quot;custom file handling&quot; to execute the shell script file when uweb returns to foreground.<br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/crontab">crontab</a>&quot;:<br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/engine.search">engine.search</a>&quot;: to define quick search engines (pressing right arrow button to use next engine to search). The file format is similar to <a href="../search/index.html">home5.search</a> but using &quot;%s&quot; as search keywords.<br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/default.siteconf">default.siteconf</a>&quot;: to save ua, js disabling, no-image mode, forbids 3rd-party resources (js and others), active scripts, global scripts for sites. Only save the difference to default ones.<br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/default.playrate">default.playrate</a>&quot;: fullscreen playing menu. The file format is same as <a href="../links/index.html">default.link</a>. Playing ratio menu items should have empty link parts such as &quot;.5x:&quot;, at least one such menu is required. All other menus must be put after playing ratio menus.<br>
@ -100,8 +101,8 @@
<p>&quot;<a href="file:///data/data/info.torapp.uweb/files/shortcut/">shortcut/</a>&quot;: dynamical shortcut, if not exist, then default to &quot;bookmark&quot;.</p>
</div>
<p>Last Modified: 8 May 2023<br>
add gissues<br>
<p>Last Modified: 25 October 2023<br>
add en/_posts/tcron.md<br>
<pre></pre>
</p>
<script>

View File

@ -3,7 +3,7 @@
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>/en/_posts/</loc>
<lastmod>2023-08-20T15:44:51+08:00</lastmod>
<lastmod>2023-10-25T13:07:04+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="zh"
@ -14,6 +14,19 @@
hreflang="en"
href="/en/_posts/"
/>
</url><url>
<loc>/en/tcron/</loc>
<lastmod>2023-10-25T13:03:03+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="zh"
href="/zh/tcron/"
/>
<xhtml:link
rel="alternate"
hreflang="en"
href="/en/tcron/"
/>
</url><url>
<loc>/en/offlinecache/</loc>
<lastmod>2023-05-09T22:48:54+08:00</lastmod>
@ -213,7 +226,7 @@
/>
</url><url>
<loc>/en/filenames/</loc>
<lastmod>2023-05-08T21:16:14+08:00</lastmod>
<lastmod>2023-10-25T13:07:04+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="zh"

104
en/tcron/index.html Normal file
View File

@ -0,0 +1,104 @@
<!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 &quot;crontab&quot; uses single space as field separator. Letters are not suppored currently. So use &quot;1&quot; for &quot;January&quot; and 2 for &quot;Tuesday&quot; etc.</p>
<h4 id="tcron">tcron</h4>
<p>With the option &quot;custom file handling&quot; enabled, &quot;default.rc&quot; runs as shell script at uweb launching time and &quot;default.rc2&quot; 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 &quot;default.rc&quot; or &quot;default.rc2&quot;.</p>
<p>usage: tcron logfile command hours [timezone delay_sec elsecommand]<br>
execute &quot;command&quot; during time interval once.<br>
where logfile modification time must be updated if &quot;command&quot; runs successfully.</p>
<p>hours: If positive, then each day is divided into multiple intervals (unit: hour), and in each interval, the &quot;command&quot; runs only once.<br>
If negative, then the unit is minute.<br>
hours could be also in &quot;hh:mm-hh:mm,...&quot; format. Ex. &quot;6:00-8:30,11:00-13:00,5:30-6:30&quot;.<br>
timezone: an integer, default to be &quot;8&quot; for Beijing China (UTC+8). &quot;0&quot; for Greenwich UK (UTC+0).<br>
delay_sec: execute &quot;command&quot; after &quot;delay_sec&quot; seconds.<br>
elsecommand: executed whenever &quot;command&quot; not run.</p>
<p>ex:<br>
set PATH=/system/bin:/data/data/info.torapp.uweb/files/bin<br>
#Empty the folder &quot;baidu&quot; every 30 days.<br>
tcron /sdcard/b &quot;rm -rf /sdcard/baidu/*;toybox touch /sdcard/b&quot; 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>

View File

@ -1,6 +1,6 @@
<script>
let verCode = %1%;
let latestV = 1013;
let latestV = 1015;
if( verCode>=latestV) alert("No updates available!");
else
location.href = "https://s1.asytech.cn/s/tQrgT5kBRg8Trry/download?path=%2F&files=uweb"+

View File

@ -4,14 +4,14 @@
<sitemap>
<loc>en/sitemap.xml</loc>
<lastmod>2023-08-20T15:44:51+08:00</lastmod>
<lastmod>2023-10-25T13:07:04+08:00</lastmod>
</sitemap>
<sitemap>
<loc>zh/sitemap.xml</loc>
<lastmod>2023-07-29T22:35:45+08:00</lastmod>
<lastmod>2023-10-25T13:06:41+08:00</lastmod>
</sitemap>

View File

@ -397,6 +397,7 @@ webview 80- 夜间模式</description>
&amp;quot;default.filecap&amp;quot;:文件特殊处理
&amp;quot;default.rc&amp;quot;:如果勾选“文件预处理”则uweb启动时运行此shell脚本。可与tcron配合运行定时任务如存储清理、网页签到等。
&amp;quot;default.rc2&amp;quot;:如果勾选“文件预处理”则uweb返回前台时运行此shell脚本。
&amp;quot;crontab&amp;quot;:
&amp;quot;engine.search&amp;quot;:格式同home5.search搜索引擎url仅支持%s语法。(搜索词部分用%s代替),供自动顺序搜索使用。
&amp;quot;default.siteconf&amp;quot;:网站独立设置保存ua、禁用js、无图、禁用第三方(js,可疑资源)、当前激活脚本、全局脚本。当前设置与默认不同才会保存。比如当前不屏蔽第三方js但屏蔽第三方可疑资源则屏蔽第三方设置与默认不同站点设置被保存。
&amp;quot;default.playrate&amp;quot;:全屏播放菜单项格式与文件default.link完全相同。倍速播放菜单链接部分为空譬如&amp;quot;.5x:&amp;quot;,倍速菜单至少有一个。链接部分非空的菜单必须在所有倍速菜单之后。

View File

@ -76,6 +76,7 @@
&quot;<a href="file:///data/data/info.torapp.uweb/files/default.filecap">default.filecap</a>&quot;:<a href="../filecap/index.html">文件特殊处理</a><br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/default.rc">default.rc</a>&quot;:如果勾选“文件预处理”则uweb启动时运行此shell脚本。可与<a href="../tools/index.html">tcron</a>配合运行定时任务,如存储清理、网页签到等。<br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/default.rc2">default.rc2</a>&quot;:如果勾选“文件预处理”则uweb返回前台时运行此shell脚本。<br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/crontab">crontab</a>&quot;:<br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/engine.search">engine.search</a>&quot;:格式同<a href="../search/index.html">home5.search</a>搜索引擎url仅支持%s语法。(搜索词部分用%s代替),供自动顺序搜索使用。<br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/default.siteconf">default.siteconf</a>&quot;:网站独立设置保存ua、禁用js、无图、禁用第三方(js,可疑资源)、当前激活脚本、全局脚本。当前设置与默认不同才会保存。比如当前不屏蔽第三方js但屏蔽第三方可疑资源则屏蔽第三方设置与默认不同站点设置被保存。<br>
&quot;<a href="file:///data/data/info.torapp.uweb/files/default.playrate">default.playrate</a>&quot;:全屏播放菜单项,格式与文件<a href="../links/index.html">default.link</a>完全相同。倍速播放菜单链接部分为空,譬如&quot;.5x:&quot;,倍速菜单至少有一个。链接部分非空的菜单必须在所有倍速菜单之后。<br>
@ -100,8 +101,8 @@
&quot;shortcut/&quot;:动态shortcut刷新目录若不存在则默认为&quot;bookmark&quot;目录。</p>
</div>
<p>Last Modified: 15 February 2023<br>
clarify home.css format<br>
<p>Last Modified: 25 October 2023<br>
add en/_posts/tcron.md<br>
<pre></pre>
</p>
<script>

View File

@ -17,5 +17,5 @@
<html><head><meta charset="utf-8"></head><script src="config.js" charset="utf-8"></script>
<script src="config.js" charset="utf-8"></script>

View File

@ -3,7 +3,7 @@
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>/zh/_posts/</loc>
<lastmod>2023-07-29T22:35:45+08:00</lastmod>
<lastmod>2023-10-25T13:06:41+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="en"
@ -333,7 +333,7 @@
/>
</url><url>
<loc>/zh/filenames/</loc>
<lastmod>2023-02-15T07:16:07+08:00</lastmod>
<lastmod>2023-10-25T13:06:41+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="en"
@ -366,6 +366,16 @@
</url><url>
<loc>/zh/tcron/</loc>
<lastmod>2023-05-19T15:10:23+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="en"
href="/en/tcron/"
/>
<xhtml:link
rel="alternate"
hreflang="zh"
href="/zh/tcron/"
/>
</url><url>
<loc>/zh/logcat/</loc>
<lastmod>2022-09-24T14:06:03+08:00</lastmod>

View File

@ -29,6 +29,10 @@
<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('en')">English</a>
<nav>
</nav>
</header>