I have a rooted Lenovo Vibe K5 Plus (A6020a46) running TWRP + Arrow OS. It doesn't provide an automatically scheduled reboot out of the box. None of the apps worked. Also the apps that claim to provide this functionality are suspiciously ad-filled and I'm not comfortable giving root permission to them.
So, here is what I've tried till now:
SMManager. Didn't work. Also, suspicious app.
Wrote an infinite loop shell script, but I'm afraid it'll make my system too busy:
while true; do if [[ "$(date +"%H")" -eq "3" ]] ; then reboot fi done
But I don't know how to autorun it on boot and I'm afraid it'll break my Android
Tried Termux (elevated) with
cronie
I'd put
0 3 * * * /system/bin/sh reboot
in/data/crontab/root
like mentioned in this link, butcrond
isn't recognised as a valid command in root shell.
Further, the init.d
directory doesn't even exist, but an init
directory does with a bunch of .rc
files.
I've ran sudo crontab /data/crontab
and then crontab -l
lists the proper crontab, but it doesn't show up anywhere else. I'm not sure it will work. Further, I'll have to always manually run this (as far as I understand it) and seriously manually rebooting is infinitely easier.
I'm out of ideas. Any suggestions appreciated. I'd prefer shell scripts over shady apps.
a6020a446
doesn't return anything).a6020a46
. Also, I just want to restart my device everyday at 3 am with possibly a shell script. I have shared what I've tried and the outcomes but my original problem still remains, I want to restart my device automatically at 3 AM. This is to have optimal performance and avoid network issues which for some reason appear when my phone has been running for abt 2+ days.system("su -c reboot");
(or maybe even call the Android API function for this, if it exists) when the alarm is triggered? Alarm clocks made correctly don't usually suffer from energy saving modes.