s a
asked on
How to download from an FTP automatically
I connect to an ftp server daily which has a bunch of folder and files within those folders....is there any way to download them automatically everyday at a certain time using windows or a freeware FTP program?
Sharad
Sharad
ASKER
Little bit confusing...
i was able to create the batch file to call the ftp text
It does log in the user but I am not sure how to select all the folders and copy them to a certain directory?
i was able to create the batch file to call the ftp text
It does log in the user but I am not sure how to select all the folders and copy them to a certain directory?
ASKER
Also....sometimes there me update on the file but the filename renames the same? Does it prompt for an overwrite?
First, you can not use script to down load directories. You need for that to use wget:
http://pages.interlog.com/~tcharron/wgetwin.html
if you are going to download multiple files from the same dir, then use
prompt
mget *.ext
http://pages.interlog.com/~tcharron/wgetwin.html
if you are going to download multiple files from the same dir, then use
prompt
mget *.ext
ASKER
First of all...your answers are extremely vague...you should understand that in this matter I dont have as much knowledge as you...hence why I selected beginner when given the option
And there has to be a simpler way to do this?
And there has to be a simpler way to do this?
Can you clarify what you want to do with example?
ASKER
Sure, absolutely
I connect to an ftp server ftp.bbb.com
with user aaa pass bbb
On this ftp server there are about 15 folders (directories), and several files in each of these folders...
ftp.bbb.com
FolderA (Inside the folder there are files aaa.xls, aaa.doc)
FolderB (Inside the folder there are files bbb.xls, bbb.doc)
FolderC (Inside the folder there are files ccc.xls, ccc.doc)
I need to copy all those folders/files into say a server called server1 (e:\portfolio)
Thanks
I connect to an ftp server ftp.bbb.com
with user aaa pass bbb
On this ftp server there are about 15 folders (directories), and several files in each of these folders...
ftp.bbb.com
FolderA (Inside the folder there are files aaa.xls, aaa.doc)
FolderB (Inside the folder there are files bbb.xls, bbb.doc)
FolderC (Inside the folder there are files ccc.xls, ccc.doc)
I need to copy all those folders/files into say a server called server1 (e:\portfolio)
Thanks
ASKER
Sorry...I should say I need the script to copy (and replace if files are already existent) the files in all those folders daily to that location....and if there are any folders that are added the ftp I want it to copy those too
download wget and install it. from command line run
e:
cd \portfolio
\path\to\wget --ftp-user=username --ftp-password=yourpasswor d -r -nH ftp://remotehostname/dir
if this works then put the commands in .bat file
e:
cd \portfolio
\path\to\wget --ftp-user=username --ftp-password=yourpasswor
if this works then put the commands in .bat file
ASKER
To install I just extract wget and click on the exe? A cmd box comes up and quickly goes away and thats it?
ok from start go to run then type cmd then enter. to find location of wget run
cd \
dir -s wget*.*
cd \
dir -s wget*.*
or
dir /s
dir /s
ASKER
And do i type the above on 3 seperate lines in the command prompt?
h:\c:
c:\> cd \portfolio
then
c:\portfolio>\path\to\wget --ftp-user=username --ftp-password=yourpasswor d -r -nH ftp://remotehostname/dir
?
h:\c:
c:\> cd \portfolio
then
c:\portfolio>\path\to\wget
?
ASKER
I see it on my desktop...I extracted it fine
But then I see the folder and double click on wget.exe and get what I said before
wget1.JPG
But then I see the folder and double click on wget.exe and get what I said before
wget1.JPG
yes, but I thought your dir is on e dirve
ASKER
It is on the C...I just used e as an example...I will use c from now on
Ok, so I guess its installed (I double clicked on wget.exe a cmd box came up and went away after a second)
Then I tried
h:\c:
c:\> cd \portfolio
then
c:\portfolio>\path\to\wget --ftp-user=username --ftp-password=yourpasswor d -r -nH ftp://remotehostname/dir
And I get "the system cannot find the path specified"
Ok, so I guess its installed (I double clicked on wget.exe a cmd box came up and went away after a second)
Then I tried
h:\c:
c:\> cd \portfolio
then
c:\portfolio>\path\to\wget
And I get "the system cannot find the path specified"
ASKER
and instead of portfolio my folder is called ftp so its
h:\c:
c:\> cd \ftp
then
c:\ftp>\path\to\wget --ftp-user=username --ftp-password=yourpasswor d -r -nH ftp://remotehostname/dir
h:\c:
c:\> cd \ftp
then
c:\ftp>\path\to\wget --ftp-user=username --ftp-password=yourpasswor
please replace \path\to by the dir name in which wget is. This is the dir to which wget.exe was extracted
ASKER
So it will be ...
c:\ftp>\path\c:\wget\wget --ftp-user=username --ftp-password=yourpasswor d -r -nH ftp://remotehostname/dir
?
c:\ftp>\path\c:\wget\wget --ftp-user=username --ftp-password=yourpasswor
?
ASKER
It is extracted into c:\wget
ok, run
c:
c:\> cd \portfolio
c:\portfolio> \wget\wget --ftp-user=username --ftp-password=yourpasswor d -r -nH ftp://remotehostname/dir
/dir at the end is the name of the dir on the ftp server
c:
c:\> cd \portfolio
c:\portfolio> \wget\wget --ftp-user=username --ftp-password=yourpasswor
/dir at the end is the name of the dir on the ftp server
ASKER
wget: unrecognized option `--ftp-user=u41165610-bull
Usage: wget [OPTION]... [URL]...
Try `wget --help' for more options.
C:\ftp>
I had two spaces between \wget and --ftp-user=username
can you show the full command you used?
ASKER
C:\ftp> \wget\wget --ftp-user=xxxx --ftp-password=aaaa -r -nH f
tp.3ianalysis.net/Qwest
wget: unrecognized option `--ftp-user=u41165610-bull
Usage: wget [OPTION]... [URL]...
Try `wget --help' for more options.
try
C:\ftp> \wget\wget --ftp-user=xxxx --ftp-password=aaaa -r -nH ftp://ftp.3ianalysis.net/Qwest
please note the ftp:// before the ftp site name
C:\ftp> \wget\wget --ftp-user=xxxx --ftp-password=aaaa -r -nH ftp://ftp.3ianalysis.net/Qwest
please note the ftp:// before the ftp site name
ASKER
Same result
ASKER
That worked very well....now if I want to put this on a network drive (which I am connected to via the Z: what would I do?
I want to put the folders in Z:\Folder
I want to put the folders in Z:\Folder
ASKER
So next I would create a .bat file
and for all the folders put something like....
\wget\wget -r -nH ftp://xxxx:maaaa@ftp.3iana lysis.net/ Qwest
\wget\wget -r -nH ftp://xxxx:maaaa@ftp.3iana lysis.net/ CORS
\wget\wget -r -nH ftp://xxxx:maaaa@ftp.3iana lysis.net/ MAS
etc?
and for all the folders put something like....
\wget\wget -r -nH ftp://xxxx:maaaa@ftp.3iana
\wget\wget -r -nH ftp://xxxx:maaaa@ftp.3iana
\wget\wget -r -nH ftp://xxxx:maaaa@ftp.3iana
etc?
ASKER
Also...some of these folder names have spaces in them for example
AB AB
So it would be
ftp://xxxx:maaaa@ftp.3iana lysis.net/ AB AB ?
AB AB
So it would be
ftp://xxxx:maaaa@ftp.3iana
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thats ok,
I am having issues installing wget and getting the script to run on other PCs...
The cmd box goes away so fast that I cant see whats going on (print scrn not quick enough either)
I want to put this on a server to run...
e:\folder1\folder2
so I put the wget extracted folder in folder2 and ran wget.exe
and my script is the same as before basically
except it is
e:
cd /folder1
cd /folder2
wget etc etc.
I think it is because it is not recognizing wget
I am having issues installing wget and getting the script to run on other PCs...
The cmd box goes away so fast that I cant see whats going on (print scrn not quick enough either)
I want to put this on a server to run...
e:\folder1\folder2
so I put the wget extracted folder in folder2 and ran wget.exe
and my script is the same as before basically
except it is
e:
cd /folder1
cd /folder2
wget etc etc.
I think it is because it is not recognizing wget
how can I help?
ASKER
umm... cannot install the wget thing on other machines for some reason...I think thats why the batch file isnt running now..
I am having issues installing wget and getting the script to run on other PCs...
The cmd box goes away so fast that I cant see whats going on (print scrn not quick enough either)
I want to put this on a server to run...
e:\folder1\folder2
so I put the wget extracted folder in folder2 and ran wget.exe
and my script is the same as before basically
except it is
e:
cd /folder1
cd /folder2
wget etc etc.
I think it is because it is not recognizing wget
I am having issues installing wget and getting the script to run on other PCs...
The cmd box goes away so fast that I cant see whats going on (print scrn not quick enough either)
I want to put this on a server to run...
e:\folder1\folder2
so I put the wget extracted folder in folder2 and ran wget.exe
and my script is the same as before basically
except it is
e:
cd /folder1
cd /folder2
wget etc etc.
I think it is because it is not recognizing wget
ASKER
any idea, sorry to rush you
ASKER
I figured it out
Thanks for your help! Will leave this question open for a day in case I have any other questions!
Thanks for your help! Will leave this question open for a day in case I have any other questions!
ASKER
Closing....thanks for your help!!
You can completely automate it using a windows script file run as a task.
Go here for a good reference:
http://www.robvanderwoude.com/ftp.html#UnattendedFTP
Good Luck,
- gurutc