• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

A Bash Issue

argedion

The TechnoFrog
I have a bash file I am working on and I am a bit stumped at one part I can't seem to figure out why I am getting this error. What I have is an adb bash to pull from data, system, and sdcard. At the moment I can do the sdcard with out an issue but when I try to do data and system I get the error "./:" is a directory.
here is what I have so far. I have looked for syntax errors but can't see them.

[HIGH]function Save_data
{
#/ save the media to local folder

#/run/media/argedion/750Data/home/phone/adb
echo "Make Local Folder: /run/media/argedion/750Data/home/phone/adb"/`date +%Y%m%d`"_Data"/
mkdir "/run/media/argedion/750Data/home/phone/adb"/`date +%Y%m%d`"_Data"/
cd "/run/media/argedion/750Data/home/phone/adb"/`date +%Y%m%d`"_Data"/
echo "Now starting the Pull Process"
`adb pull /data/` "./"
echo "Pull is finished"

}

function Save_system
{
#/ save the media to local folder
echo "Make Local Folder: /run/media/argedion/750Data/home/phone/adb"/`date +%Y%m%d`"_System"/
mkdir "/run/media/argedion/750Data/home/phone/adb"/`date +%Y%m%d`"_System"/
cd "/run/media/argedion/750Data/home/phone/adb"/`date +%Y%m%d`"_System"/
echo "Now starting the Pull Process"
`adb pull /system/` "./"
echo "Pull is finished"

}[/HIGH]

The SDCARD one runs with out the error
[HIGH]function Save_Media
{
#/ save the media to local folder
echo "Make Local Folder: /home/argedion/sdcard"/`date +%Y%m%d`"_LTESDCARD"/
mkdir "/home/argedion/sdcard"/`date +%Y%m%d`"_LTESDCARD"/
cd ~/sdcard/`date +%Y%m%d`"_LTESDCARD"/
echo "Now starting the Pull Process"
`adb pull /mnt/sdcard/` "./"
echo "Pull is finished"

}[/HIGH]

the error shows that
line 65 "./:" is a directory. (the line is `adb pull /data/` "./")

Now it is important to know that I can get everything from data before the error or I can get everything from system before the error but if i try to go from data to system then i only get data and then the error

yet the same code works flawlessly with the SDCARD
 
cd "/run/media/argedion/750Data/home/phone/adb"/`date +%Y%m%d`"_System"/

Looking at that. I'm pretty tired. But shouldn't it be similar to the last one? eg:

cd ~/run/media/......?

Or is it in " from / to adb because it needs to be? I haven't made too many bash scripts...but why not try it that way? Remove the quotes and cd ~/run

Unless you've tried that already. Then..I'm not sure o.o
 
Yeah I would firstly try and replicate the structure from SD card in data and system

mkdir "/home/argedion/data"/`date +%Y%m%d`"_data"/
mkdir "/home/argedion/system"/`date +%Y%m%d`"_system/

Try and get that working first to rule out any local issues on your computer FS
 
Well It still gives me an error even when I change the directory to /home/argedion/phone/

so don't think it is a structure issue.
 
The only syntax difference I can see is the method in which you cd. So did you change your scripts exactly as I suggested? If so, perhaps also match the cd type just to clarify.

Why are you using "./"
 
ok removed all " and it seems to be working fine for going from data to system and the ./ is to tell it to save in the current directory which is the directory we saved to other wise it will save it in the same directory as the bash (my bin directory) originally before the quotes I was getting errors with the SDCARD save data though seems to be doing fine with out the quotes I'll report back on system and SDCARD with out the quotes.
 
Everything is fine originally i must have had an error that putting the quotes to I solved "Accidently" maybe a space or something i didn't see. Now all is well thanks guys for your help :D
 
Back
Top Bottom