Hello my goal is to create a buckup/restore script that does the restore from a safe file on phone when some files are missing or damaged in some way .
So i need help to get it started
By my idea it should have already a prebuilt backup file from which it will restore missing files
So after flashing a zip or at boot it should always run and check if something is missing from specified location example system/etc/init.d
And when it finishes it should react if there are files that are missing or are damaged
For the files that miss that is simple but how to create a script that will check if the file is damaged
simple by checking it size
ok i know how this would work in theory but i dont know how to writte that kind of a script so please
help thank you i made a simple check files script here:
but how to backup restore from backup folder if it is missing or damaged dont know please help me
this is an idea about a smart self repair script so dont abuse and help
latest code not working but an improvment i think
found the solution for the copying eror it gave its in this line
looks like this :
and it should look like this:
Two more things left:
1.make it run at every boot or for at a specific time 3 days a week
2.make it check if files are damaged
theese two steps will make it like artificial inteligence :D
hi i made some changes but i keep running into erors
the script now looks like this
i get two erors one is
So i need help to get it started
By my idea it should have already a prebuilt backup file from which it will restore missing files
So after flashing a zip or at boot it should always run and check if something is missing from specified location example system/etc/init.d
And when it finishes it should react if there are files that are missing or are damaged
For the files that miss that is simple but how to create a script that will check if the file is damaged
simple by checking it size
ok i know how this would work in theory but i dont know how to writte that kind of a script so please
help thank you i made a simple check files script here:
Code:
#!/system/bin/sh
clear
sleep 2
echo ""
echo "SPL ENGINE CORE is installed "
sleep 2
echo ""
echo "Checking for SPL ENGINE A.I. CORE ..."
sleep 1
if [ -e /system/spl_engine_1996 ]; then
echo ""
echo "SPL ENGINE CORE is installed..."
sleep 1
else
echo ""
echo "SPL ENGINE CORE binary was not found,please Re-flash SPL Transcender then try again!"
sleep 1
fithis is an idea about a smart self repair script so dont abuse and help
latest code not working but an improvment i think
Code:
#!/system/bin/sh
clear
sleep 2
echo ""
echo "SPL ENGINE CORE is installed "
sleep 2
echo ""
echo "Checking for SPL ENGINE A.I. CORE ..."
sleep 1
if [ -e /system/spl_engine_1996 ]; then
echo ""
echo "SPL ENGINE CORE is installed..."
sleep 1
else
echo ""
echo "SPL ENGINE CORE binary was not found,please Re-flash SPL Transcender then try again!" then
cp ./system/data/secure/files/spl_engine_1996 ./system
sleep 1
fifound the solution for the copying eror it gave its in this line
looks like this :
Code:
cp ./system/data/secure/files/spl_engine_1996 ./systemCode:
cp -rf ./system/data/secure/files/spl_engine_1996 ./systemTwo more things left:
1.make it run at every boot or for at a specific time 3 days a week
2.make it check if files are damaged
theese two steps will make it like artificial inteligence :D
hi i made some changes but i keep running into erors
the script now looks like this
Code:
#!/system/bin/sh
clear
FILENAME=/system/spl_engine_1996
FILESIZE=$(stat -c%s "$FILENAME")
RIGHTFILESIZE=3821568
sleep 2
echo ""
echo "SPL ENGINE CORE is installed "
sleep 2
echo ""
echo "Checking for SPL ENGINE A.I. CORE ..."
sleep 1
if -d /system/spl_engine_1996 && [FILESIZE=$(stat -c%s "$FILENAME")];
if [ $FILESIZE == RIGHTFILESIZE ]; then
echo file is the right size $RIGHTFILESIZE
elsif
echo file is corrupt size is under $RIGHTFILESIZE kilobytes
fi
then
echo ""
echo "SPL ENGINE CORE is installed..."
sleep 1
else
echo ""
echo "SPL ENGINE CORE binary was not found,!"
cp -rf ./system/data/secure/files/spl_engine_1996 ./system
sleep 1
fiHTML Code:
/system/bin/testres[31] [-d :not found
/system/bin/testres[31] [: RIGHTFILESIZE : unexpected operator/operand