Perl query MySQL to csv and send using SFTP
Perl query MySQL to csv and send using SFTP is project number 254058 posted at GetAFreelancer.com. Click here to post your own project.
Closed
(Selected Service Provider james5400)
| Status: |
Closed
|
| Budget: |
$30-250
|
| Created: |
04/24/2008 at 10:02 EDT |
| Bidding Ends: |
05/01/2008 at 10:02 EDT
|
| Project Creator: |
dfarrell
Buyer Rating:           (14 reviews)
|
| Description: |
- This is a Perl job.
I need a script that can be called from cron or shell and does the following:
- Query a MySQL table to select a set of records.
- If the result is not empty, export all selected records, but just a subset of columns (defined by an array of column names that is hard-coded in the Perl script) to a single csv file (named using a static value plus the current date and time) to a local directory. In the process, convert a few field values (such as converting default date values “0000-00-00” to null values).
- If the csv file was created, connect to an external FTP server (address and login hard coded in the Perl script) using SFTP protocol [<< IMPORTANT] and upload the file to the FTP server.
- Send an email (addresses hard-coded in the Perl script) indicating outcome including date, result (success, ftp connection error, no records, etc), and number of records found in the query.
The server is Linux. Any Perl modules can be installed.
It needs to be well commented especially the query, column subset, ftp info, and email info areas (so I can edit them).
Please don’t propose/use an existing third-party script. I don’t want all the baggage of a “full-featured” script that does 20 things when all I need is the few simple things above. If you really want to use existing scripts, they must be open source and you need to package them in a way that the excess code is removed or “hidden” -- AND YOU NEED TO EXPLAIN THEM IN YOUR BID or else I’ll assume you’re using none.
Thanks. -
|
| Job Type: |
|
| Database: |
MySQL
|
| Operating system: |
Linux
|
| Bid count: |
13
|
| Average bid: |
$ 57
|
|

|