[GUIDE][Difficulty: Intermediate] Weekly TWRP Backups

It's good practice to run a full backup of your ROM and user data every once in awhile, in case you flash something and get into a bootloop. Thanks to TWRP's scripting capabilities, we can trigger a weekly backup.

Prerequisites
  1. Root Access


Instructions
  1. Create a new Profile named TWRP Backup.
  2. Create a Time context, and choose a time at night you want the TWRP backup to take place. For me, I made it at 4:00AM. To pick a single time, check both "From" and "To" and put the exact same time in both.
  3. No need to name the task anything, just enter its configuration.
  4. Code --> Run Shell. This is the code you'll need:
    Code:
    chmod 0777 /cache/recovery
    echo "wipe cache\nwipe dalvik\nbackup SDBOM weeklybackup \ncmd reboot" > /cache/recovery/openrecoveryscript
    Be VERY sure that this is typed exactly as such! Tick "Use Root" and then exit.
  5. Files --> Delete Directory. Delete the TWRP/BACKUPS/YOURDEVICEUNIQUEID/weeklybackup. Check "Recurse." In order to get your device's unique ID, you need to simply navigate to TWRP/BACKUPS using any file explorer. You should have already made a previous backup, as TWRP will automatically create this folder. (Note: since you likely don't have a weeklybackup folder already here, it will likely fail the first time. You can easily just skip this action and make a backup once with this name, and then it'll work from then onwards).
  6. Plugin --> Secure Settings. Go to Root Settings --> Reboot Options --> Reboot Recovery.
  7. Exit out the task editing, and now add a few more contexts to make the backup run at an appropriate time. I added a power context so it only occurs when my phone is charging; I added a date context so it only runs on Sunday; and I also added a WiFi connected context so it only occurs when I'm at home.

Comments

Popular posts from this blog

DR VAKU® Swadesi Pulse Oximeter Fingertip, Blood Oxygen Saturation Monitor Fingertip, Blood Oxygen Meter Finger Oximeter Finger with Pulse, with Four Color TFT Screen [Battery Included]

[TOOL] SRK Tool Huawei Bootloader/ROOT/Recovery/Backup/Utility (STABLE - 20161002)

Xiaomi Redmi Note 4 review: A good option in its price segment