LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (https://www.linuxquestions.org/questions/aix-43/)
-   -   HOW to create a bash script to download FTP? (https://www.linuxquestions.org/questions/aix-43/how-to-create-a-bash-script-to-download-ftp-4175441732/)

sudiyanto24 12-17-2012 12:08 AM

HOW to create a bash script to download FTP?
 
Hi friends ...
I will make a bash script to donwload the file *. zipped through FTP.
FTP Serever:
http://ftp2.pegadaian.co.id/kanwil
username: "username"
password: "password"

in the FTP directory there are several folders according to the day, such as Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday.

how to create a bash script to download the *. zipped by the name of the day is in the FTP directory?

my email : sudiyanto.ujank@gmail.com

ruario 12-17-2012 12:52 AM

You don't really need a script, or at least not a long one. The following would work in bash:
Code:

wget --user=yourusername --password=yourpassword http://ftp2.pegadaian.co.id/kanwil/$(date +"%A")/*.zip


All times are GMT -5. The time now is 05:47 PM.