[Discuss] upgrading Android, and backing up texts

John Blomfield jabfield at shaw.ca
Thu Sep 18 08:19:06 PDT 2014


I mount my Android tablet with "jmptfs". This program mounts mpt devices 
and comes with different names depending on the Linux distribution. I 
then backup using rsync. I have written a cron script to do this job on 
at regular times and remind me to plug in the device. To use this you 
will need to ensure that you have the Android adb suite of development 
software and fuse file system software installed. There are few 
statements you can un-comment to test when running on the command line.

#!/bin/bash


DEBUGLOG=/home/john/data/logs/samsungbkup_log.txt
ERRORLOG=/home/john/data/logs/samsungbkup_error_log.txt
MOUNTLOG=/home/john/data/logs/samsung_mount_log.txt
SOURCEDIR=/mnt/mtp/
DESTDIR=/home/john/data/Samsung_GTab3_8/
DEVICE=3230ce87e28a70b9
ADB=/home/john/data/Computing/Android/adt-bundle-linux-x86_64-20131030/sdk/platform-tools/adb

export DISPLAY=:0

LOOP=yes
while [ $LOOP = yes ] ; do
# loop until device plugged in or quit
     LINE=$( $ADB devices | grep $DEVICE )
#    echo $LINE
    TEMP=( $LINE )
#    echo $TEMP
     NUM=${TEMP[0]}
     echo $NUM
     if [ "$NUM" != "$DEVICE" ] ; then
     # Drive is not plugged in
       /usr/bin/kdialog --title 'NO Device' --warningcontinuecancel 
'Please plug-in Device to USB\nand then Click Continue.\nClick Cancel to 
exit.';
       if [ $? = 0 ] ; then
         LOOP2=yes
         # do another loop to see if tablet has NOW been plugged in
         else
          exit 1
       fi
       else
     LOOP=no
     fi
done

if /usr/bin/jmtpfs /mnt/mtp/ > $MOUNTLOG; then
  echo "MTP is now mounted"
   if /usr/bin/rsync -avz --delete $SOURCEDIR $DESTDIR 1> $DEBUGLOG 2> 
$ERRORLOG; then
       if /usr/bin/kdialog --title 'Samsung_GTab3_8 Rsync' --yesno 
'Backup Complete\nWould you like to view log?'; then
     /usr/bin/kwrite $DEBUGLOG
       fi
   else
     if /usr/bin/kdialog --title 'Samsung_GTab3_8 Rsync' --warningyesno 
'Some Errors Found!\nDo You Want to View Error Log?'; then \
       /usr/bin/kwrite $ERRORLOG
       /usr/bin/fusermount -u /mnt/mtp
       exit 2
     fi
   fi
else
   if /usr/bin/kdialog --title 'Samsung_GTab3_8 Mount' --warningyesno 
'Mount Error!\nDo You Want to View Error Log?'; then
     /usr/bin/kwrite $ERRORLOG
     /usr/bin/fusermount -u /mnt/mtp
     exit 4
   else
   echo "MTP is NOT mounted"
   # Just in case unmount it
   /usr/bin/fusermount -u /mnt/mtp
   exit 3
   fi
fi
/usr/bin/fusermount -u /mnt/mtp
echo "MTP is now UN-mounted"
exit 0

Good luck John


On 09/17/2014 10:46 PM, Darren Duncan wrote:
> Hello,
>
> I have an HTC One S phone that I bought brand new in February of last 
> year.
>
> The phone came with Android 4.0 and then in summer last year there was 
> an over the air update which brought it to Android 4.1.  There was 
> also a small such update this last spring, but that was it.
>
> When going to the built-in software update feature, there are no 
> updates offered.
>
> What do you recommend as the best way for keeping this phone up to 
> date with newer Android versions and their associated security fixes 
> or feature updates?
>
> Also, what do you recommend as the best way for backing up the text 
> messages stored on this phone to my computer, ostensibly as some kind 
> of plain text file that any program can open.
>
> The phone's internal 16GB storage is partitioned into 2 volumes, one 
> with the operating system and the stored text messages, and the other 
> with stuff like my photos and videos.  I can access and backup the 
> second volume using Android File Transfer on my computer, but I can't 
> get at the text messages.
>
> Also, if you haven't heard of this yet:
>
> http://arstechnica.com/security/2014/09/android-browser-flaw-a-privacy-disaster-for-half-of-android-users/ 
>
>
> Thank you in advance for help with any of the above problems.
>
> -- Darren Duncan
> _______________________________________________
> Discuss mailing list
> Discuss at vlug.org
> http://lists.vlug.org/mailman/listinfo/discuss
>


-- 
John Blomfield
Delivered by Thunderbird Email on Linux OpenSuse-KDE4

Old John B's Linux Notes http://www.oldjohnbslinux.wordpress.com




More information about the Discuss mailing list