Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何设置每5秒运行一次? #1

Open
jw10126121 opened this issue Jun 19, 2020 · 6 comments
Open

如何设置每5秒运行一次? #1

jw10126121 opened this issue Jun 19, 2020 · 6 comments

Comments

@jw10126121
Copy link

如题

@smallerxie
Copy link
Owner

smallerxie commented Jun 19, 2020

编辑你路由器的crontab文件(我的是/etc/crontabs/root文件),或者在luci界面中System-Scheduled Tasks中直接编辑:

# kickass
*/5 * * * * /bin/sh /usr/kickout.sh
# Attention that /usr/kickout.sh is your script's location

具体的crontab语法规则上网搜一下就有。

@jw10126121
Copy link
Author

感谢,我去试一下。。。

@jxph1123
Copy link

编辑你路由器的crontab文件(我的是/etc/crontabs/root文件),或者在luci界面中System-Scheduled Tasks中直接编辑:

# kickass
*/5 * * * * /bin/sh /usr/kickout.sh
# Attention that /usr/kickout.sh is your script's location

具体的crontab语法规则上网搜一下就有。

你这是5分钟运行一次吧,楼主问的是5秒 。

@smallerxie
Copy link
Owner

是的,上面是5分钟的,看错了抱歉。
比一分钟更快的频率,我能想到的就只有将脚本设置成循环(或者在脚本中调用自身)并配合sleep语句来实现了。
如果有更好的方案欢迎评论,。

@smallerxie smallerxie reopened this Aug 15, 2020
@jxph1123
Copy link

jxph1123 commented Aug 18, 2020

我试了下你最后的sleep,调用自身,设成5秒,负载可以接受。。
没搞懂Padavan自带弱信号剔除设置功能,openwrt始终没有,不知道为啥。。。其实弱信号剔除对组建简单的AP扩展很有用,比如我就是用wifi放大器扩展,又不能刷机,只能弱信号剔除,要不然手机始终连着弱的,得手动开关wifi才会自动找到强信号,很郁闷。

@jw10126121
Copy link
Author

我试了下你最后的sleep,调用自身,设成5秒,负载可以接受。。
没搞懂Padavan自带弱信号剔除设置功能,openwrt始终没有,不知道为啥。。。其实弱信号剔除对组建简单的AP扩展很有用,比如我就是用wifi放大器扩展,又不能刷机,只能弱信号剔除,要不然手机始终连着弱的,得手动开关wifi才会自动找到强信号,很郁闷。

我设置了3秒运行1次,负载受不了!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants