1. Download the #1 Android News App:   EarlyBird - News for Android
    Dismiss Notice

A Backup Routine for us all

Last Updated:

  1. argedion

    argedion The TechnoFrog Moderator

    I have been on the forums for a year and a half and I can't even count the number of times that I have seen someone come in all panicky wanting to get stuff off their SDCARD when there is a problem with the device. We ofcourse offer the best assistance as we can to help however sometimes that is simply not enough. The very best way to retrieve stuff on the SDCARD is when there are no problems with device.

    We here at Phandroid understand your pain and wish to help you develop a healthy backup plan so you can maintain all those precious photos and documents you have collected over the year(s) with your current device. There are several methods we are going to discuss here for both the rooted and non-rooted users. While we could assume that rooted users already have a healthy backup plan we rather not assume and just offer assistance in this desired area of device ownership.

    There are several ways to maintain a healthy backup plan however for some it may not be as easy as it is for others. Lets say you have a phone with internal memory of 8gig however you have no external way to put a card in. Lets take it even further and say that you don't even own a computer to plug the device into and make a backup of your precious data then what? Well for you there are some alternatives out there and one of the best ones happens to be Cloud Storage. There are many sites out there that offer free storage. Choose whom you wish to choose and start learning how to upload files on to their servers. Most offer a convenient app to do this for you.

    Learning to what to backup can be just as intimidating as finding the right storage cloud for your purposes. Rule of thumb is that if you created it you want it. (Photos taken with camera, Documents you saved etc.) There are a few places that allow you to stream media over to your device by keeping your music and video's on their servers. Amazon and Google Play Music are a couple. They give you reasonable amounts of space so you can keep a bunch of music on their servers. It's your responsibility to know what you need to keep and where the best place to store it is. Now is the time to practice uploading stuff once a day to the cloud of your choice before a disaster happens.

    Next are those who are fortunate enough to have a computer that you can back up stuff to and you really don't trust “the cloud” anyways. So what are your options well since you have a computer they are not as limited as those with out a computer. For instance if you have a 32 gig external card and 8 gig of internal you can back up all of it on your computer provided you have ample space to do so. In this example you need about 45gigs of space. (always leave a buffer)

    Plugging your device into your computer via its cable allows you several options for backing up. The first and probably one of the easiest is the Drag and Drop Method. This consist of grabbing the contents with a mouse and dragging them to a folder on the computer and dropping that content. (Note: Backup Process's can take a while to complete so you may have to wait a while depending on how much you back up)

    Dragging and Droping is nice however it uses up a bunch of resources that you could be using doing other task. No matter what OS you have you can use a script file to save your stuff over to disk for you. If your an advanced user you probably have a folder where you keep your scripts Infact you probably have a backup script for your computer in there. You know its a simple get the mount point and do a copy routine.

    So what if your not that advanced then what? What alternatives do you have? This is where Phandroid takes things into their own hands and gets you what you need. A workable script that will do this for you. All you really need to know is how to “Point and Click” Ofcourse there are some things you need to do to get it to that point and these things we will walk you through here.

    First you need to get a hold of a powerful little program known as ADB. We have what is known as a Mini SDK here which offers all you will need. Second you will need to place the files on your hard drive and put them in your path variable. A tutorial on how to do this is at the end of the thread where the Mini-SDK is. If you don't wish to change the path variable you will need to change the script to show where your adb is stored. So instead of :

    ADB="adb" you will need to make it looks similar to this:
    ADB=&#8221;C:\sdk-tools\adb&#8221; <--- needs to be exact and should not contain spaces as a best practice.

    So what if your not on windows then you should change accordingly but its just best to place it in your path variable.

    ADB=&#8221;/home/user/bin/adb&#8221; or similar

    Note - using our Mini-SDK and its installer will create the path for you in Linux or Mac OS X.

    The script is designed to save it in your home folder under the format of :
    Serailnumber_date so it could look like this:


    Serial Number refers to the devices serial number and ofcourse the date is the current date. A Windows Version of the script can be found in the "Attached Files" area at the bottom of this post.

    Drawbacks or Cons of the Script file. You need to be responsible and ensure that the path variable is handled with caution and to make sure you have no typo's. Also you need to make sure that where it is saving the contents is where you want them. For instance I have a backup drive that I store all my Backups on so it only makes since to keep all my device backups on the same hard drive. This is not in my home folder so I had to modify the save_path variable in the script. Things advanced users will have no issues with.

    Pro's of the script is you can set it up to run at certain times all you need to do is insure the device is connected at that time and ready to go.

    Download's referenced above:

    Old versions:
    Windows Version of the script (original version 10-March-2013)

    Attached Files:

    Last edited by a moderator: Feb 27, 2015
  2. argedion

    argedion The TechnoFrog Moderator

    scary alien's Windows versions of the script can be found in the "Attached Files" area at the bottom of the first post.

    (sa edit: link updated 27-Feb-2015 to reference version/attachment at the bottom of the first post)

    Credits Goes to:
    Scary Alien
    Out Of Phases

    More to follow as they tell me who they are.
    Last edited by a moderator: Feb 27, 2015
  3. argedion

    argedion The TechnoFrog Moderator

    Please keep this thread to questions about using the script files or making yours workable. Please do not use this thread as a help me I lost my stuff thread. You need to make a new thread in your device's forum.
  4. doogald

    doogald Guides Guide

    It should be noted that in order to use ADB you need to enable the USB debugging setting on the phone.

    And, to add to the list of drawbacks and cons, even if you have a password lock on the phone, if USB debugging is enabled, and if your phone is lost or stolen, and if the finder/thief is sophisticated - yes, that's a lot of ifs - then they can also use the ADB application to access files and data on your phone.

    The likelihood if this happening is probably very, very small, but you should know about this before enabling USB debugging.
    scary alien and argedion like this.
  5. EarlyMon

    EarlyMon The PearlyMon Moderator

    I'd like to point out that the *nix version of the script works on a Mac, but may need a softlink for adb added for either Mac or Linux, as the Mini-SDK has retained platform-specific adb names.

    Also, the save sets are under an android_storage_backups directory.

    Fixed in latest version of the Mini-SDK :)
    palmtree5 and argedion like this.
  6. dusf

    dusf Member


    I am going to follow the instructions you have outlined before I root my Samsung Galaxy S3 Mini I8910-N. I have only ever rooted one phone before and I wish I had backed it up.

    Before rooting what about using apps like MyBackup Pro, Astro, Samsung Kies?

    People talk about Titanium Backup and Clockwork Rom Manager but I think you need root first to use those?

    Does your method do a better job than all of them? Is it the only backup method you would use for a pre-root device or would you use an app too, if so which one?

    Does your method backup settings for paid apps?
  7. EarlyMon

    EarlyMon The PearlyMon Moderator

    You do need to be rooted to use Titanium Backup or MyBackup Root - those are app backups. You also need to be rooted for Rom Manager, but proceed with caution, it doesn't support everything and you can get screwed up if your phone isn't supported.

    If you're not rooted then MyBackup Pro or Carbon, plus SMS Backup+ with either one, is the way to go for app backups.

    Ours is not an app backup and doesn't try to be.

    This is strictly an sd card backup, known to work with some phones, not all, so you will want to verify it by giving it a try before trusting it. If our method doesn't work for you, then you have to mount as USB storage when you plug in your phone and use drag and drop to backup your sd card.

    Hope this helps! :)
    Frisco likes this.
  8. dusf

    dusf Member

    Thanks, it does help! :)

    What about my settings and firmware, can they be backed up? Regular phone settings and settings for installed free and paid apps?

    Can my firmware be backed up? I already have a copy of the firmware I found online so maybe it's not required...
    EarlyMon likes this.
  9. argedion

    argedion The TechnoFrog Moderator

    in order to save app settings you will need a program like Titanium Backup. As far as system settings the only thing I can think of is a nandroid.

    Be careful with firmware that can brick you in a flash. (pun intended)

    This backup is only for the internal/external storage device and not for anything else.
    EarlyMon likes this.
  10. argedion

    argedion The TechnoFrog Moderator

    EarlyMon's *nix backup script, good for Linux, OS X and Windows PCs running CYGWIN

    Preferred and supported use - grab our Mini-SDK and then unzip this file in the same sdk-tools folder you used to run the Mini-SDK installer.

    Alternatively, use a full SDK distribution and ensure that adb is in your PATH environment variable.


    • unzip backup-sd.sh.zip
    • chmod 755 backup-sd.sh
    • To use:
      • ./backup-sd.sh

    Files are saved under:

    • If using our Mini-SDK or Cygwin:
      • sdk-tools/android_storage_backups
    • Otherwise:
      • $HOME/android_storage_backups
    Saved directory folders are named:

    • serial-number_date
    • Optionally, serial-number_date_time if run more than once on the same day
    • Multiple devices can be backed up and distinguished by their serial numbers

    Note - Cygwin creates a Linux environment under Windows.

    Credits Goes to:
    Scary Alien
    Out Of Phases

    More to follow as they tell me who they are.

    Attached Files:

    scary alien likes this.
  11. tthomas824

    tthomas824 Member

    "A", please disregard the pm I sent you. I find this extremely helpful. You folks are awesome!!!~T
    D-U-R-X and EarlyMon like this.
  12. iav

    iav New Member

    Windows script firs not work for me first.
    Windows7 x64

    Reason was first run of line
    [HIGH]"%adb%" get-serialno > tmp_work [/HIGH]locks file tmp_work0, and all later writes into fails.
    Then I change it like
    "%adb%" get-serialno > tmp_work0
    set/p snum= < tmp_work0
    [/HIGH]Maybe, it will be usable for somebody.
    scary alien likes this.
  13. radiobob

    radiobob New Member

    I'm trying to get the script to work with my S4 and I get

    # adb: C:\sdk-tools\adb.exe
    # snum: * daemon not running. starting it now on port 5037 *
    # nc: * daemon not running. starting it now on port 5037 *
    # card1: none
    # card2: none
    # wdate: 20131125
    # wtime: 0514
    # target1: C:\sdk-tools\android_storage_backups\* daemon not running. starting it now on port 5037 *_20131125_0514
    # target2: C:\sdk-tools\android_storage_backups\* daemon not running. starting it now on port 5037 *_20131125_0514_2nd

    It then just gives up. I will paste the whole debug log here if that would be OK....
  14. EarlyMon

    EarlyMon The PearlyMon Moderator

    Do you maybe have a firewall messing with it?

    In your dos/command window, please say -

    adb devices

    Let's look at getting that going first.
    D-U-R-X and scary alien like this.
  15. radiobob

    radiobob New Member

    I'll returm after the holiday!
  16. rocketmonkeys

    rocketmonkeys Active Member

    This helped me a ton. I was seeing things like this:
    [HIGH]Press any key to continue . . .
    The process cannot access the file because it is being used by another process.

    The first line ""%adb%" get-serialno > tmp_work" was locking the "tmp_work" file for some reason. Killing adb.exe in process explorer freed it up, but the script still dies first.

    iav's fix fixes it for the next run, but then the new file "tmp_work0" is locked as well. I fixed mine by having the script kill & restart adb before each run. Technically that means the file may be locked after the script is over, but at least the script runs successfully.

    Where it says "pause", add this beneath:
    echo # start the backup or [control-c] to quit:
    echo #

    REM Restart adb.exe to make sure it's not locking the tmp_work file
    "%adb%" kill-server
    "%adb%" start-server

    rem get this device's serial number
    scary alien and palmtree5 like this.
  17. scary alien

    scary alien not really so scary Moderator

    Thank you very much, iav and rocketmonkeys!

    Those suggestions were perfect and very simple to implement :) :thumbup:.

    Here's the new version of the Windows Version of the script: View attachment win-backup-sd.zip

    (all links above here updated with the new version)

  18. desdroid

    desdroid Member

    This is backing up the External SD on the Note 10.1

    How to make it backup the internal SD?
  19. EarlyMon

    EarlyMon The PearlyMon Moderator

    This is designed to back up both unless there are processes blocking it.

    On a rooted device, it won't care and simply back up both.

    If there are blocking processes then you'll want to try a drag and drop backup from your pc using the built-in access. Less convenient but it's the results that count.
  20. desdroid

    desdroid Member


    It's impossible to fully backup via mmtp because any hidden files are not shown.

    It's also impossible to backup the internal sd via USB mass storage because the internal sd can't be dismounted from the android os at least with recent phones.
  21. EarlyMon

    EarlyMon The PearlyMon Moderator

    Yep. That's why we built this tool.

    But for unrooted devices, and other makers restrictions such as those we've seen from Motorola, this has limitations.

    This centers on adb pull if you're familiar with that. :)
    scary alien, argedion and desdroid like this.
    Last edited: Dec 14, 2014
  22. marcelser

    marcelser New Member

    Just tried the windows script. But obviously it does not work on CM10.2. Although I have galaxy s4 with just one sdcard, the script reports that there are multiple sd-cards installed which of course is just not the case.

    I think the problem is that the internal sdcard is present on various paths like /storage/emulated/0 and /storage/emulated/legacy and /storage/sdcard0, and the external card is at /storage/sdcard1.

    Can anyone update this script to make it with with CM 10.2 which is based on android 4.3.1?

    Thanks a lot
  23. EarlyMon

    EarlyMon The PearlyMon Moderator

    The intention is to capture all user storage.

    Despite the Jellybean emulation, it's no big deal to identify internal storage as sdcard0 and your SD card as sdcard1.

    This way, everything you have in either volume will get backed up - and that's what we built this for. :)
  24. kwest12

    kwest12 Well-Known Member

    Hi, I'm trying to figure out if this tool will be able to do what I want but after reading through everything I'm still not 100% sure.

    I would like to back up my Bionic entirely, system, data, internal storage, external sdcard, etc. Will this tool be able to do what I'm hoping? I'm rooted and ROMed to a 4.4.4 based ROM if that matters.

    EDIT: Also, sorry for bumping an old thread :/
  25. EarlyMon

    EarlyMon The PearlyMon Moderator

    No worries about the bump my friend! :)

    The issue here is that you're using a Motorola.

    Don't get me wrong - I totally dig Motorola.

    However - we use a standard debugging call to pull off the backup - and Motorola uses a standard trick to block that method on a lot of models.

    We don't do /system or traditional /data - only user storage, meaning internal and/or sd card data or media storage.

    Despite what I said about Motorola, the game opens up often for rooted users.

    Nonetheless, you're wise to proceed with caution. :)

    Sorry that I can't be more black and white but the truth is what the truth is. ;)

Share This Page