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
/
浏览:4633 Views views
/
分类:乐此不倦
/