PDA

View Full Version : Dump DB to CSV



cmadsen
06-03-2007, 08:36 PM
I have a form that is inputing to a mySQL db. I need to dump that table to a csv file and then FTP that file to a XP folder on another computer. The problem I'm having is the transfer of the file to the XP computer.

Twey
06-03-2007, 08:49 PM
In what language?

cmadsen
06-04-2007, 12:39 AM
PHP. This job needs to be automatic thru a cron job.

Twey
06-04-2007, 12:10 PM
Hm, it's probably easiest to use a shell script for the FTP transfer:
ftp -in <<EOF
open ftp.backupsite.com
user youruser yourpassword
mput /some/directory/*
bye
EOF

cmadsen
06-04-2007, 04:14 PM
Thanks. I forgot all about shell scripting.