Linux Shell Script

Imekamilika Ilichapishwa Aug 3, 2006 Kulipwa wakati wa kujifungua
Imekamilika Kulipwa wakati wa kujifungua

**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

Uhandisi Linux MySQL PHP Software Architecture Majaribio ya Software

Kitambulisho cha Mradi: #3694951

Kuhusu mradi

15 mapendekezo Mradi wa mbali Ipo mtandaoni %project.latestActivity_relativeTime|badilisha%

Imetuzwa kwa:

programmersnet

See private message.

$68 USD kwa siku 14
(Maoni 14)
3.4

15 wafanyakazi huru wanazabuni wastani wa $92 kwa kazi hii

prsis

See private message.

$425 USD kwa siku 14
(Maoni 24)
6.3
codersarge

See private message.

$170 USD kwa siku 14
(Maoni 38)
5.8
kenanek

See private message.

$102 USD kwa siku 14
(Maoni 36)
5.3
inadilemma

See private message.

$42.5 USD kwa siku 14
(Maoni 40)
5.1
dmrusu

See private message.

$102 USD kwa siku 14
(Maoni 50)
4.4
chrisjensenvw

See private message.

$18.7 USD kwa siku 14
(Maoni 6)
3.9
eisimoes

See private message.

$34 USD kwa siku 14
(Maoni 12)
3.7
dragonchaos

See private message.

$63.75 USD kwa siku 14
(Maoni 8)
3.0
zeby

See private message.

$51 USD kwa siku 14
(Maoni 15)
2.5
netcoresoftware

See private message.

$51 USD kwa siku 14
(Maoni 3)
2.6
solarian

See private message.

$68 USD kwa siku 14
(Maoni 5)
2.8
rubencamarg

See private message.

$25.5 USD kwa siku 14
(Maoni 15)
3.1
myfvw

See private message.

$127.5 USD kwa siku 14
(Maoni 0)
0.0
evaldasvw

See private message.

$29.75 USD kwa siku 14
(Maoni 0)
0.0