![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DJ Sweet 0.9.7 (Default branch) | iBot | Software Releases - RSS News | 0 | 12-10-2008 06:10 AM |
| how to make your bash script run on a machine with csh and bash | npatwardhan | Shell Programming and Scripting | 3 | 11-19-2008 04:17 AM |
| Sweet Home 3D: version 1.4 released | iBot | Software Releases - RSS News | 0 | 10-10-2008 01:10 AM |
| passing variable from bash to perl from bash script | arsidh | Shell Programming and Scripting | 10 | 06-04-2008 12:25 PM |
| Abyss: a small, sweet Web server | iBot | UNIX and Linux RSS News | 0 | 02-21-2008 12:10 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
My first FTP bash script - sweet!
Hey - thanks for reading this!
I just finished my first bash script that will handle daily ftp downloads for me, but I'm certain it could use some improvement. Its job is to download IDX data from an ftp host (which is 24 hours behind) and I download a mix of *.txt.gz file and .tar files. There are also "old" archives that I want to ignore. Here's the code (its works fairly well though I get an occasional timeout) Code:
#!/bin/bash clear USER="my_username" PASS='my$password' FTPSERVER="idx.fnismls.com" YESTERDAY=$(TZ=EST26EDT date +%Y%m%d) #echo $YESTERDAY FILE1="pics-commercial-industrial-$YESTERDAY.tar" FILE2="pics-condo-townhouse-$YESTERDAY.tar" FILE3="pics-lots and land-$YESTERDAY.tar" FILE4="pics-multi family-$YESTERDAY.tar" FILE5="pics-residential-$YESTERDAY.tar" #echo $FILE ftp -i -n $FTPSERVER << EOF user $USER $PASS cd /IDX2 bin mget *.txt.gz get $FILE1 get $FILE2 get $FILE3 get $FILE4 get $FILE5 bye Thanks so much!!! |
![]() |
| Bookmarks |
| Tags |
| bash, ftp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|