Settings

Theme

Ask HN: Free tool to schedule and receive SQL emails?

1 points by bruno2223 9 years ago · 4 comments · 1 min read


There is any tool to schedule a SQL query and then receive the results every day?

I need to receive an email every morning telling me if my crawlers did run fine last night. I can do this with a simple SQL query.

I am willing to build this tool (in Node.js) if this tool does not exists just yet.

* No SaaS, please. I'm looking for a self-hosted option. I do not want to give a read-only password of my database for anybody.

viraptor 9 years ago

Why not use cron?

    mysql the_database << "SELECT ...." | mail -s "Daily report" your@email
You can insert some formatter in between if you want. If you'd rather send emails from a proper account and not local mailer, you can use ssmtp and configure a smarthost. (http://www.cyberciti.biz/tips/linux-use-gmail-as-a-smarthost...)
  • bruno2223OP 9 years ago

    But how to send the result of this SQL query in a beautiful table format in email's body?

    It would be nice to have HTML tags with CSS style.

    I am thinking in build an easy tool to do that, really similar to your solution using cronjob, but more fancy and easy to ready on email (also with an .csv attached with all data)

    What do u think?

    • flukus 9 years ago

      > But how to send the result of this SQL query in a beautiful table format in email's body?

      The same way. But get cron to invoke a ruby/python/bash script or program to get the output you want.

  • flukus 9 years ago

    Or if you're stuck on windows, the task scheduler:

    https://technet.microsoft.com/en-us/library/cc721931(v=ws.11...

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection