|
-
Tiger Shark
FTP Batch Script to Backup Website
Hi guys, I am looking to create a Windows batch (.bat) file to backup my Website. I have searched a million sites on how to create this, and I am a little lost. Let me show you what I have so far (details removed, of course):
ftp ftp.myhost.com
#wait here 3 secs
myusername
#wait here 3 secs
mypassword
#wait here 3 secs
cd \(the directory i want to download from)
#wait here 6 secs
getdir thedirectory
I don't actually know how to make it wait, but I thought the command was 'wait' or 'pause'. The other problem is, I want to get a directory and all subdirectories, all files in those, and I want to overwrite what is on my local machine. I know that to download to a certain directory on my machine, I need to run the script from that directory, or add a line like (cd C:\thedirectory). Can someone please enlighten me?? Thanks in advance!!!
-
Hammerhead Shark
I know this is a really stupid comment, but, I use wget to mirror sites under Linux. You might look for an equivalent for windows (might make your searches a bit more accurate).
-
As far as I know, you can't do this with a batch file, at least not how you are trying to. The batch file will wait until ftp.exe finishes executing before running the rest of your batch file. Take the following simple example:
There are two obvious ways this could by handled:
1. The script executes ftp, then sends the "bye" command to ftp, causing it to quit.
2. The script executes ftp. Once you quit out of ftp, the script tries to execute "bye."
Batch files work like #2. It will start where it left off when it called ftp, which isn't what you want.
System specs:
| Core i5 750 | GA-P55A-UD3 | 4.0 GB G.skill DDR3 1600 | eVGA 470 GTX |
| Intel X25-M 80 GB SSD | WD 5000AAKS | Lian Li PC-7FN | Corsair TX750W |
| Windows 7 Home 64-bit |
-
Tiger Shark
ok, I totally see what you're saying how it won't work like I want it to. I guess my next logical questions are:
1) Do you know of a good Windows equivalent of the software mentioned above?
2) Can something be written in Perl or VB to handle this?
I'm sure someone else has wanted to do this before.
Thanks for the replies so far though guys!
-
Super Bunny Mod
wget is available in Windows binaries, http://wget.sunsite.dk/
there is also HTTrack, http://www.httrack.com/index.php
If your sig is longer than your post then type more.
-
Tiger Shark
Thanks a mint! I'll try one or both of them this weekend!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|