如何使用crontab在Android的? [英] How to use crontab in Android?

查看:2539
本文介绍了如何使用crontab在Android的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到答案,我的问题:是否有可能执行的crontab 使用 busybox的重新启动的Andr​​oid (或其它装置)

I can't find answer to my question: Is it possible to run crontab to reboot Android using busybox (or other means)

想跑crontab中,并抱怨未知UID 0。

Tried to run crontab, and it complain about unknown uid 0.

想跑重新启动,它什么都不做。

Tried to run reboot, and it does nothing.

还是我要求不可能的事,现在呢?

Or I am asking for the impossible right now?

推荐答案

Requrements

1.Root访问

2.Busybox:对的crond服务

2.Busybox : for 'crond' service

3.init.d:在开机启动'的crond服务

3.init.d : to start 'crond' service at boot

创建的cronjob

创建目录/数据/ crontab中/中的cronjob文件的文件名的根。写下您的cronjob文件根里。该文件设置可执行权限根

Create the cronjob file in directory /data/crontab/ with filename root. Write your cronjob inside the file 'root'. Set executable permissions for the file 'root'

测试,无需重新启动

现在在设备打开任何终端仿真程序和运行下面的命令。

Now open any terminal emulator in device and run the following commands..

苏 -

的crond -b -c /数据/的cronjob

crond -b -c /data/cronjob

现在的crond服务将启动,检查类型...

Now the crond service will start, to check type...

顶|的grep的crond

top | grep crond

开始的crond在启动

创建一个文件/system/etc/init.d具有可执行权限,并输入以下行

create a file at /system/etc/init.d with executable permission and enter the following lines

的crond -b -c /数据/的crond

crond -b -c /data/crond

示例cronjobs

53 * * * *重启

53 * * * * reboot

将重新启动您的设备上的每一个小时的第53分钟。

Will reboot your device on 53rd minute of every hour.

这篇关于如何使用crontab在Android的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆