Linux Shell Script

Completed Posted Aug 3, 2006 Paid on delivery
Completed 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

Engineering Linux MySQL PHP Software Architecture Software Testing

Project ID: #3694951

About the project

15 proposals Remote project Active Aug 10, 2006

Awarded to:

programmersnet

See private message.

$68 USD in 14 days
(14 Reviews)
3.4

15 freelancers are bidding on average $92 for this job

prsis

See private message.

$425 USD in 14 days
(24 Reviews)
6.3
codersarge

See private message.

$170 USD in 14 days
(38 Reviews)
5.8
kenanek

See private message.

$102 USD in 14 days
(36 Reviews)
5.3
inadilemma

See private message.

$42.5 USD in 14 days
(40 Reviews)
5.1
dmrusu

See private message.

$102 USD in 14 days
(50 Reviews)
4.4
chrisjensenvw

See private message.

$18.7 USD in 14 days
(6 Reviews)
3.9
eisimoes

See private message.

$34 USD in 14 days
(12 Reviews)
3.7
dragonchaos

See private message.

$63.75 USD in 14 days
(8 Reviews)
3.0
zeby

See private message.

$51 USD in 14 days
(15 Reviews)
2.5
netcoresoftware

See private message.

$51 USD in 14 days
(3 Reviews)
2.6
solarian

See private message.

$68 USD in 14 days
(5 Reviews)
2.8
rubencamarg

See private message.

$25.5 USD in 14 days
(15 Reviews)
3.1
myfvw

See private message.

$127.5 USD in 14 days
(0 Reviews)
0.0
evaldasvw

See private message.

$29.75 USD in 14 days
(0 Reviews)
0.0