Skip to content

Instantly share code, notes, and snippets.

@pgampe
pgampe / twrp.sh
Last active November 13, 2016 12:44 — forked from inhies/twrp.sh
Creates TWRP compatible backups over USB using ADB without any files ever touching your SD card.
#!/bin/bash
#
# Version 1.4
#
# twrp.sh -- a TWRP compatible backup script for your computer
# Brought to you by inhies
#
# This script creates TWRP compatible backups over usb using adb and magikz
# By default it makes a folder in the standard TWRP date--time format (I think)
# To restore these backups, place the folder in /sdcard/TWRP/BACKUPS/<serialnumber>/
#!/bin/bash
AUTHOR="$1"
MKTEMP=$(which mktemp)
if [[ -n $MKTEMP ]]; then
TEMP1=$($MKTEMP)
TEMP2=$($MKTEMP)
else
TEMP1="/tmp/$(basename $0).$$.tmp"