[bash] Remote file existence check
Hi!
Would anyone have an idea how (using bash script) to check if remote file exists? I'd need to know if file ftp://user:pass@server.com/dir/somefile.txt has already been created, if so, wget would down it. I just need a command which would return 'true' or 'false'. I have experimented with test and wget, but it's a wrong path, I guess. I'm getting kinda confused :/ Thanks in advance, Dan |
Maybe something like
Code:
if [ -e ftp://user:pass@server.com/dir/somefile.txt ]; then |
Quote:
|
What's wrong with just attempting to wget it? If it's not there, wget errors out...
To test for the presence of the file you'd have to authenticate anyway (based on what you've shown here). |
There's nothing wrong with wget :) But thanks anyway, you put me on right track :)
|
You may also consider the following options to wget:
Quote:
|
All times are GMT -5. The time now is 04:19 PM. |