Automated emails and daily reports

(4 posts) (2 voices)

Tags:

  1. timdt74, Member

    First off let me say that I am really liking the product so far. Just purchased the premium version.

    I have configured mydbr to create reports and can successfully send out emails. I would love some help on the system sending out automated daily reports. Is there a way for me to set up a cron to tell mydbr to generate a report? I have set up my report so the date range is a user parameter but would like my automated report to just send out the previos days stats.

    Thanks in advance for any help.

  2. myDBR Team, Key Master

    Glad you like myDBR.

    You can determine the date range inside the report and just call the report in cron without any changing parameters.

    You can make a cron entry by calling myDBR report URL using wget/curl. myDBR supports HTTP basic access authentication so you can pass the username / password via command options if required.

    --
    myDBR Team

  3. timdt74, Member

    Would that date range within the report always be static until I change it again? I want the cron the run the report daily and email out the previous days stats. What would I use in the date parameter to always pic the previous day when the report is run?

    Thanks

  4. myDBR Team, Key Master

    If you only need to set date range relative to current date, you do not need to use parameters in report but you can use a where clause in your report like this:


    select ...
    from mydb.table
    where date_column between date_add( current_date(), interval -1 day ) and current_date()

    This would select rows from yesterday to today.

    --
    myDBR Team


Reply

You must log in to post.