lundi 8 décembre 2014

[Q] Moving files on start up topic

03:59






OK I admit this is somewhat of a n00b question, to a person who knows how Droids works with storage anyway.

The original issue I have is I changed from a phone with no internal memory to one with internal + micro SD. Without too much hacking/modding/customization outside of built in settings or simple file path edits, I want to keep as much of my stuff on the micro SD rather than internal mem incase the phone goes kaput suddenly (like my ol' Droid 3). Unfortunately a few apps here and there point to the internal "sdcard" and can not be changed to the external.

In the end, I was quite happy to simply have a little script that ran on start up (i.e. regularly enough) that moved files from particular folders from to the external sd card. By no means is it the most fancy solution but initially something I could script up myself and be simplistic in the sense that it was just simple file operations and used existing stuff (e.g. no ext apps).

However it's not working and from my logging of things it looks like because at the time userinit.sh runs not all storage has yet been mounted (file/folder not found)?

Here is my simple script cut down to just one path example.


Code:


#!/system/bin/sh

ULOG=/data/local/test.log
date >> $ULOG

cp -R /mnt/sdcard/Pictures /mnt/external_sd 2>> $ULOG
if [ "$?" -eq "0" ]
    rm -R /mnt/sdcard/Pictures/* 2>> $ULOG
fi


(and I tried /storage/sdcard0 and /storage/sdcard1 instead of /mnt's with no difference, FWIW)






Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 commentaires:

Enregistrer un commentaire

 

© 2013 Mobile Probleme. All rights resevered. Designed by Templateism

Back To Top