Jump to content

Android shell scripting: cron (or anything to schedule scripts)


Guest ltpitt

Recommended Posts

Hi all!

Trying to circumvent the error that won't allow us to backup our sd-ext using clockworkmod recovery (more info here: http://android.modac...86#entry1889186) I wrote four very simple scripts to switch the sd-ext content for the two roms I am using more (t&l and miui) that work without problems in gscript or script manager (you can find those apps for free on the market) and allow me to change quite easily rom without reinstalling everything or using my laptop to restore sd-ext:

Two backup scripts that I use before doing a nandroid restore of the "other" rom:

# Backup sdext2 partition - t&l

tar cvvf /sdcard/backuptl.tgz /data/sdext2
or
# Backup sdext2 partition - miui

tar cvvf /sdcard/backupmiui.tgz /data/sdext2
And two restore scripts (destructive lines are commented) that I execute after restoring the nandroid backup I need:
# Delete current sdext partition files (be extra careful before removing the following rows comments: they will delete and/or overwrite your current sd-ext content)

# rm /data/sdext2/* -R

# Restore sdext2 t&l backup

# tar xvvf /sdcard/backuptl.tgz /data/sdext2
or
# Delete current sdext partition files (be extra careful before removing the following rows comments: they will delete and/or overwrite your current sd-ext content)

# rm /data/sdext2/* -R

# Restore sdext2 miui backup

# tar xvvf /sdcard/backupmiui.tgz /data/sdext2

I'm happy with the result but I'd be happier if anyone has better solutions or clues about how scheduling the sdext partition backup overnight.

Thanks for ideas / help :)

Edited by ltpitt
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.