How to use crontab in Android?

Requrements

1.Root access

2.Busybox : for ‘crond’ service

3.init.d : to start ‘crond’ service at boot

Creating 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’

Test without rebooting

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

su –

crond -b -c /data/cronjob

Now the crond service will start, to check type…

top | grep crond

Start crond at booto

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

crond -b -c /data/crond

Example cronjobs

53 * * * * reboot

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

时间:2015/06/13
/
浏览:2455 Views views
/
分类:乐此不倦
/

你目前的身份是游客,评论请输入昵称和电邮!
输入评论内容...

Please type the characters of this captcha image in the input box

请键入图片中的字符