• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

help with nandroid backup via tasker

silentwitness

Android Expert
Aug 19, 2012
1,098
320
Bombay India
hey i found an article with steps on how to create a nandroid backup automatically via tasker i downloaded the files and imported them into tasker but they dont seem to work. The profiles have a red exclamation mark next to them. Has anyone created a profile to do this? I have attached the profile that i had imported.
 

Attachments

  • Nandroid_Daily_Backup_V4.zip
    1.8 KB · Views: 140
OK Think I have a profile I created to do this for you. Just one drawback, you need SecureSettings and the pro version of it, which in the UK is 95 pence. This is needed to reboot into recovery itself.

Let me just finalise testing.


Edit > OK so this zip contains a folder called clockworkmod. This must replace your existing clockworkmod on your (INTERNAL) sdcard (when unzipped)

Within there you have /backup/auto_backup where your nandroid goes, and 1x archive location currently also set to /backup/auto_archive

What happens is the profile triggers at 4am saturday (when you're asleep). It runs a bash script I wrote.

The script, deletes whatever is in auto_archive and puts auto_backup in archive (this way when you fill up auto_backup in a minute, you always have 1 new and 1 old backup)

Then, the script puts a file that tells recovery what to do. It copies a file to /cache/recovery/extendedcommand which tells recovery what to do when it boots up.

Then heres the slightly annoying bit. The profile then tells securesettings (pro - which you have to pay for) to reboot into recovery.

Recovery reads extended command and does backup, completes and boots back into android.


OK so I didnt figure out how to get the extendedcommand to tell recovery to backup to extSdCard so it backs up to internal.

You CAN change the location of auto_archive from within the nandroid.sh file in the backups folder if you wish. However, the problem here is currently, moving from backup to archive on the internal sd is instant. Changing to external would take a while to move the 3GB or whatever your backup is.

Of course then you have that backup twice too.

Sionvce I bought secure settings pro just to do this, I will probably keep this task too. However, since I have foldersync app syncing my sd card to my NAS anyway, I probably dont need the autobackup.

Anyway zip attached. Enjoy
 
  • Like
Reactions: silentwitness
Upvote 0
OK I got carried away there and thought of a better way.

If you have folders within clockworkmod/backup, then its not easy to restore them if you need them. You have to move them back into backup first which is a pain.

So I managed to get the foles datestamped whilst still only keeping 2 backups. I feel quite impressed with myself here. Its a little more complicated.

Theres a zip with a bash script and the profile in it. The script MUST go in /sdcard/clockworkmod/

EDIT> Doesnt need Secure settings pro any more :(

http://androidforums.com/tasker/678204-profile-root-auto-nandroid-backup.html
 
  • Like
Reactions: silentwitness
Upvote 0
Yep, unzip the zip so you have /sdcard/clockworkmod/nandroid.sh

If you extract the .prf there too. When you open the prf in a file manager, it should ask to open with tasker. Open with tasker and it will say something like "Profile can now be added by the UI".

Then open Tasker, long press the Profile Tab > import and it should be listed to be imported.

One thing though,

If you decide to test it today, be aware your nandroid backups will have the same name. Not sure what this will mean, so if you test the task, do it once, then change the date of the folder to yesterday instead of today and change the file (index1 or 2) contents to match
 
  • Like
Reactions: silentwitness
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones