Loading session...

AI Roundtable Open Poll · 1 models

macro script that automatically restarts Xiaomi Redmi 10C with root access every 7 days

Answer: Use a Magisk background script with a sleep timer or a root-aware automation app like MacroDroid. (All 1 models agreed)

Model Responses

Claude Fable 5

Answer: The most reliable way is a small shell script calling `su -c reboot` scheduled either through a root-aware automation app (Tasker/MacroDroid) or a Magisk boot script with a 7-day timer, since stock Android offers no native cron.

Since the Redmi 10C is rooted, the reboot itself is trivial — the challenge is scheduling it every 7 days. Here are the two practical approaches: **Option 1 — MacroDroid or Tasker (easiest):** Create a macro with: - Trigger: 'Day/Time' → pick a day of the week (e.g., Sunday) and a time (e.g., 04:00 AM, when the phone is idle). - Action: 'Shell Script' (rooted) with the command: `reboot` (or `svc power reboot` for a cleaner shutdown). In MacroDroid enable the 'Use Root' checkbox; in Tasker use 'Run Shell' with 'Use Root' ticked. Grant the app superuser permission in Magisk when prompted. This survives reboots automatically because the app re-registers its triggers on boot. **Option 2 — Pure script via Magisk service.d (no apps needed):** Place a script in `/data/adb/service.d/weekly_reboot.sh` and make it executable (`chmod 755`): ```sh #!/system/bin/sh # Wait for boot to complete while [ "$(getprop sys.boot_completed)" != "1" ]; do sleep 10; done # Sleep 7 days (604800 seconds), then reboot (sleep 604800 && /system/bin/svc power reboot) & ``` Because the script re-runs on every boot, the 7-day countdown restarts automatically after each reboot, creating a perpetual weekly cycle. If you need an exact day/time rather than '7 days since last boot', use BusyBox crond instead: install BusyBox via Magisk, create a crontab entry like `0 4 * * 0 /system/bin/svc power reboot` (Sunday 4 AM), and start `crond` from a service.d script. **Caveats specific to MIUI/HyperOS on the Redmi 10C:** - MIUI aggressively kills background apps; if using MacroDroid/Tasker, lock the app in recents, set battery saver to 'No restrictions', and enable Autostart in Security settings, otherwise the trigger may never fire. - Prefer `svc power reboot` over raw `reboot` — it goes through the system server for a graceful restart, reducing risk of filesystem issues. - Avoid scheduling the reboot during times the device might be in use, and be aware that if you use a SIM PIN or require credentials before first unlock, some apps won't function until you manually unlock after each restart.

Final Summary

The AI Roundtable outlines two primary methods to schedule a weekly reboot on a rooted Redmi 10C. Claude Fable 5 advises utilizing an automation app like MacroDroid with root shell permissions, or writing a lightweight Magisk `service.d` script that sleeps for seven days. To avoid filesystem corruption, the model recommends calling `svc power reboot` for a graceful system shutdown.

All 1 models agreed