Link to home
Start Free TrialLog in
Avatar of Okyanet
Okyanet

asked on

Daily export MySQL reports to email

I have an ecommerce site that currently allows me to run transaction reports on demand.

However, I want to have the reports run automatically, every day at 0100am.

I imagine this could be done with a crontab and some kind of query to pull the relevant data from the MySQL database, format it into a csv file, then send the csv as an attachment to a specified email address.

Is there a software tool that will allow me to do all of the above?

Or is there a relatively easy way to implement it with a crontab set to execute a script that will do that?

I have very limited programming skills so it would be great to find an existing script that I could adapt to  my site. Thanks in advance!

ps. my site is hosted on a unix VPS, administrated via Plesk. Please let me know if more info is required
SOLUTION
Avatar of theGhost_k8
theGhost_k8
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You may use mutt to send file as an attachment.

mutt -s "mail-subject" -a /tmp/result.txt mail-id@host.ext  < mail-body-file.txt
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
split in 2
Avatar of Okyanet
Okyanet

ASKER

Thanks guys!