Linux Shell Script
$30-5000 USD
Paid on delivery
**Overview:**
I need a linux shell script that will access an FTP Server, download a text file, then parse and insert all data from that text file into a database table (mysql). I will be setting up a cron job to run this script (1-3 times per month). The script must use many variables in case there are changes with the file (such as file name and location), database (such as database name, table name, and login creditials), ftp (such as host address, file name, and login credentials).
**Steps to be automated by 1 or more scripts:**
1.) Download a file from an FTP server using $variables as the username / password / site / and file
2.) Drop all records from a table if the file is > then a specified size (let's use 1 MB to start)
3.) Insert all data from the downloaded file into mysql
..** Must parse data and issue insert into commands/load data commands
..** Please note that mysql will promt for username and password
4.) An email must then be sent to a specified email address displaying a success or failure message
**Additional Information:**
The first line in the downloaded file will always be a header line and must be ignored. The data I need imported beings on line 2.
For simplicity I have broken down the sample_data.txt. Below is each of the column names (in the mysql db) followed by their starting position, then length. Please double check that these values are correct.
imo (0,7)
vessel_name (7,30)
x_vessel_name( 37,30)
ship_type (67,20)
gt (87,11)
dwt (98,11)
call_sign (109,16)
loa (125,13)
mb (138,13)
eb (151,13)
draft (164,13)
draught (177,13)
Please trim (remove leading and trailing blank spaces) before inserting into the database
**See the attached file '[login to view URL]' for data with exact formatting.
Please contact me with any questions and suggestions. I'd like to have this project _completed by August 17th_.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Fedora Core 5 (linux) bash shell MySql Server 5.0
Project ID: #3694951