Bash Script
I have two questions related to bash scripting and ftp. First how can i check if a url is valid. Like if ftp://ftp.arandomsite/test exists or if ftp://arandomsite exists but not test. Also how can i get a list of all the files in an ftp directory stored into a variable. Thanks in advance.
|
Hi,
I highly recommend using ckermit, which can be launched from bash of course. kermit -C 'take myckermit.scr' will launch a kermit script myckermit.scr, where you can do commands like ftp ipaddress ftp dir ftp binary ftp get foo.bin ftp close |
I would use curl :
Code:
#!/bin/bash ./myftp ftp://arandomsite |
Curl is a good suggestion, also look into programs like:
ncftp ncftpbatch ncftpbookmarks ncftpget ncftpls ncftpput ncftpspooler also lftp is scriptable ... you can place all your FTP commands in a text file and have lftp execute them. I use it for a backup script. Michael. |
All times are GMT -5. The time now is 11:26 PM. |