FORUMS
Remove All Ads from XDA

[GUIDE][Difficulty: Intermediate] Weekly TWRP Backups

833 posts
Thanks Meter: 1,866
 
Post Reply Email Thread
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.


That's it! This should satisfy the average TWRP user. MAKE THOSE BACKUPS!
The Following 31 Users Say Thank You to MishaalRahman For This Useful Post: [ View ] Gift MishaalRahman Ad-Free
 
 
9th March 2016, 01:42 PM |#2  
Senior Member
Flag Shipley, West Yorkshire
Thanks Meter: 89
 
More
I've been meaning to try to found out how to do this.

Thank you
The Following User Says Thank You to PeteT For This Useful Post: [ View ] Gift PeteT Ad-Free
9th March 2016, 03:04 PM |#3  
rambo69's Avatar
Senior Member
Flag Tilburg
Thanks Meter: 49
 
More
For me it doesn't work
It's boots to recovery
Then it bootloops with message
"formatting cache using ext4"

Edit* I'm on 6.0.1 with TWRP 3.0
9th March 2016, 03:17 PM |#4  
Follow_and_Feel's Avatar
Senior Member
Flag Montabaur
Thanks Meter: 213
 
More
It works flawlessy, awesome! Thanks op
9th March 2016, 06:28 PM |#5  
Senior Member
Here
Thanks Meter: 643
 
More
Reboot Recovery in Secure Settings is a PRO option!
9th March 2016, 06:39 PM |#6  
bjoswald's Avatar
Senior Member
Flag Ocala
Thanks Meter: 44
 
More
Are there any decent alternatives to TWRP these days?
9th March 2016, 07:04 PM |#7  
Senior Member
Here
Thanks Meter: 643
 
More
Quote:
Originally Posted by bjoswald

Are there any decent alternatives to TWRP these days?

Not really the thread to ask this question..
Could search for phillz it's available for select devices (but TWRP is better) and thats about it..
The Following User Says Thank You to Giblet-dono For This Useful Post: [ View ] Gift Giblet-dono Ad-Free
9th March 2016, 07:14 PM |#8  
Senior Member
Anaheim
Thanks Meter: 126
 
More
Quote:
Originally Posted by Giblet-dono

Reboot Recovery in Secure Settings is a PRO option!

Instead of using secure setting pro option, can't we just use run root shell command reboot recovery command?
9th March 2016, 07:33 PM |#9  
Senior Member
Here
Thanks Meter: 643
 
More
No idea.. what I DO know is that this script gave me a hang on boot :<
Make a complete backup before running the script for the first time!
I am not sure yet why, but maybe someone (OP?) can help me out here..
I'm using an HTC One M8 with Marshmallow rom (ViperOneM8) which is stock HTC Sense based.
I use TWRP 2.7.8.0
9th March 2016, 08:24 PM |#10  
Senior Member
Thanks Meter: 93
 
More
Guess this doesn't work so well if you have secure boot enabled requiring a pin/passphrase.
9th March 2016, 08:30 PM |#11  
Follow_and_Feel's Avatar
Senior Member
Flag Montabaur
Thanks Meter: 213
 
More
So as I stated above this worked pretty well for me (it made the backup, rebooted me), but if I now go into tasker the "make-backup"-profile is gone?! This seems pretty pointless, if I have to set up the whole thing every time I use it ^^
Post Reply Subscribe to Thread

Tags
backup, tasker, twrp, weekly

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes