If I was doing it I would do it in a PHP script and run it from the command line via the cron job: htt... [by crushdev]
I am connecting to a remote mysql server with an ssh tunnel. I can normally do this a few ways. One is with sshpass and ssh via command line
sshpass 'passwd' ssh -f user@address -L 3307:127.0.0.1:3306 -N
mysql -h 127.0.0.1 -P 3307 -u User -pPass
Another way is with Perl DBI. First using the perl function system to open the ssh tunnel with the ssh command above.
I am trying to get the log from MySQL into a file when executing a script from the command line.
mysql -v mydb u- alex -p**** < please_run_me.sql > /tmp/file.log
Now, the work gets done, but file.log is empty. I thought that -v would give me the desired output.