Stuck on bootloop how to pull files using adb(rooted) - adb

My samsung galaxy note 3 is stuck on bootloop(stuck on logo with sparkels animation),went into recovery mode and tried to pull mp3 files from downloads i get a message remote file does not exist,i cant pull any file i get the same message!is there a way to get the data ?
Root-Cwm- based recovery v6.0.5.0
image

You are receiving the error above for a couple of different reasons.
You are spelling the directories incorrectly
ADB pull is used for pulling specific file names.
Assuming adb can actually access the devices while its stuck in a boot loop (you could test this by running 'adb devices' and see if you receive a response.
What you need to do is run the following command to list all the files in your "downloads folder"
adb shell ls -r /sdcard/download
Every file in your downloads folder will be listed. You can then do the following the pull the files
adb pull /sdcard/download/filename.mp3

Related

Programmatic way to get open files info similar to Computer Management\Shared Folders\Open Files? (Server 2012R2)

Trying to track open files\locks on a server due to application issues. I can use Computer Management\Shared Folders\Open Files and see this data. The fields I get are:
Open File, Accessed By, Type, # Locks, Open Mode
Using this tool, I can export the list to a CSV. In trying to come up with a batch file to do it automatically, I found OpenFiles.exe. The script works fine, the issue is I only get these fields:
ID, Accessed By, Type, Open File (Path\executable)
There is no option with OpenFiles.exe to get the #Locks data. Which is frustrating, considering the data I want is right there in the Windows tool! Has anyone previously tackled this issue?
Try out the Handle utility from System Internals at https://learn.microsoft.com/en-us/sysinternals/downloads/handle
You should be able to get all of the information you are looking for with this command:
handle.exe -a -u -s

What are common pscp command issues?

I am transferring files from Windows server to Unix server using pscp command.
About 30% files are not getting transferred, I am not getting any specific error in the logs,apart from this:
pscp: MP*.xml: No such file or directory
What can be the possible reason of some files not getting transferred?
What are the common issues with pscp?
Please suggest.
The source files you are trying to copy could be locked for editing. I suggest you close all other applications, restart, and try again.

psftp.exe get files from the server and delete

I'm using psftp.exe to download files from the server. Is there an easy way to delete these files once I have downloaded them but leave the new ones that might have appeared on the server when I was downloading to be downloaded next time?
Here's my command line:
psftp.exe domain.com -i keys\private.ppk
get *.xml
Edit: I want to download the files from a Linux box to a Windows PC.
There's no easy way to do this with psftp. You would have to parse its output to find files that were successfully downloaded.
Though you can do this easily with WinSCP. Just use get -delete *.xml command.
Full WinSCP script would be:
open sftp://domain.com/ -privatekey=keys\private.ppk -hostkey=...
get -delete *.xml
exit
See an introduction to WinSCP scripting.
See also a guide for converting PSFTP script to WinSCP.
You can also have WinSCP GUI generate script like this for you.
(I'm the author of WinSCP)
Martin's answer is good. The below is more industrial.
Moving them to a staging area before the download may be prudent.
Generally you would move/rename the files on the server as a starting point. They are going to be deleted anyway so nothing should miss them? nor would you want to fall back over a recent file.
(so restart after this point in the event of a subsequent failure)
Then perform the download.
Then perform the delete.
I would approach the issue differently. Instead of deleting the file from the server, add the downloaded filename to a local table of "Already downloaded files". Then when you scan the FTP again for new files, ignore any that are in that table.
That way the next time you run your download script you only get the new files, but the old files remain on the server.
You could have another script that runs periodically and deletes all files over a certain age.
WINSCP is alright, and Martin (the author) drops in to practically every PuTTy thread to recommend it, but it's a fully GUI-based app and not for me. If you really need everything to be done on the commandline then WINSCP is often not an option.

batch file ftp authentication issue

I'm trying to download some files using a batch file, however after reading the username line an error is thrown 'Invalid command'.
In my batch file I call my ftp file as follows:
ftp -n -s:ftp_download.txt
my ftp_download.txt looks like this:
open myname.com
test#myname.com
test
lcd C:\myDownloads
cd download_files
get MY_NEW_FILES_*.xml
bye
However after the test#myname.com line an error is thrown 'Invalid command' and thus the script does not connect to my ftp server.
When authenticating as follows:
open myname.com
user test#myname.com test
I get the 'not connected' error
However using this username (test#myname.com) and password (test) I'm still able to connect using Filezilla .
Am I missing a command somewhere?
To those, like CharlesKSQL, who might stumble upon my question.
Here's how I got it to work (it turned out I had to use sftp for some reason so make sure it's enabled on your server);
The script (ftp_download.txt) contains the following:
option batch abort
option confirm off
open sftp://<username>:<password>#<host> -hostkey="<fingerprint/key>"
option transfer binary
cd <your folder>
get <some file>
If you do not know the fingerprint and/or key; you can find these in FileZilla when connecting trough sftp. They are shown in the popup that show up when you connect to your server for the first time or you could click the little lock-icon in the statusbar on the bottom right when you are connected already.
Now to actually connect you'll need a little bit of software (when using Windows) to create the secure connection. I used WinSCP.
You can download the portable executables here and place them (for easy usage) in the same folder as your batch file.
Then you can call the executable in your batch file by adding a parameter:
winscp.exe /script=ftp_download.txt
which should then execute your download script.
P.S.: it's been a while since I finished this, it's still working as far as I know.
Your text file should look like this:
open myname.com
user
<enter username here> <password here>
lcd C:\myDownloads
cd download_files
get MY_NEW_FILES_*.xml
bye
Try that and see if it helps

Automate cygwin via batch file

Long story short... we have multiple servers which we run perflog monitoring on every night. My job is to convert these logs to .csv format and send them to my e-mail.
This bit it already automated via a .sh script an ex-employee wrote.
What I want automated is to run a batch job after the perfmon logging to look at a specific folder and find the latest .blg file and run the sh script on it (the script is called upload) so that I don't have to log in to each server and do it manually.
e.g.
upload myInitials cd /cygdrive/someLocation/logs/$latestFile$.blg
myInitials and the location can be hard-coded... I just wouldn't know how to find the latest file in the folder and automate it all via a batch file.
Any pointers would be very helpful!
# Jeremy:
Sorry, I probably should have mentioned in my question that the servers are running 2003 and 2008.
I don't think it would be absolutely necessary to register a change notification on the folder - If the log runs from noon till 7 in the morning, the script will run immediately after (you can set a script to run after a perfmon log has finished in log properties) so the log will almost definitely be the latest file in the folder anyway.
Like I said, I already have a .sh file in place to convert to csv and send to my e-mail, I just need to incorporate it into a batch file so that instead of me going to each of the servers and opening up cygwin and typing upload xx /cygdrive/location/logs/xyz.blg, I can have it automated to run straight after the log has finished without me having to RDC into it.
Thanks for the input!
If you have a Shell script and you job is to call the shell script from a windows batch file then this will work.This assumes the cygwin is installed in C:
Contents of start_cyg.bat
#echo off
set PATH=%PATH%:"C:\Cygwin\bin"
rem bash --login -i
bash "/cygdrive/d/cyg.sh"
Contents of cyg.sh
#!/bin/bash
TAIL=`ls -lrt | tail -1`
echo "TAIL:$TAIL"
If you call start_cyg.bat from windows command prompt you can get the output of the cyg.sh in the console
for getting newest file in a directory, ls -1tr | tail -1 should work.
First, I don't know if it would meet your requirements, but the Windows Task Scheduler 2 in Vista+ is very robust and can trigger an event even based on log entries. However, extraction and parsing of that log entry may require some scripting, and might have concurrency issues, even if that log entry did indicate the last used process. Chances are none of this is helpful, but just throwing it out there.
Programatically, it would be simple as you can register a change notification on a folder. When a change occurs, you go find the latest file. Then launch the batch file to launch your shell script, or whatever your desired sequence may be.
I think cygwin may even support change notification events via scripting, though I'm unsure. I believe there are linux extensions for this, but I may be wrong.
If it were me, I'd just write a little C++ app to do whatever I wanted.. but for you maybe any (or more likely none) of the above helps ;o.

Resources