scratchpad:automated_sql_reports
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
scratchpad:automated_sql_reports [2011/04/29 03:19] – created bshum | scratchpad:automated_sql_reports [2022/02/10 13:34] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Automated SQL Report Scripting (Draft) ====== | ====== Automated SQL Report Scripting (Draft) ====== | ||
+ | |||
+ | This document is a scratchpad created quickly during the 2011 Evergreen Conference. | ||
+ | |||
+ | **NOTE: Updates can be found at the permanent location - [[evergreen-reports: | ||
===== Requirements ===== | ===== Requirements ===== | ||
Line 27: | Line 31: | ||
* The RECIPIENT variable defines the e-mail address you will be sending to | * The RECIPIENT variable defines the e-mail address you will be sending to | ||
- | < | + | < |
#!/bin/sh | #!/bin/sh | ||
Line 76: | Line 80: | ||
This file is called TEST_daily_circ.postgresql. | This file is called TEST_daily_circ.postgresql. | ||
- | < | + | < |
\o / | \o / | ||
Line 102: | Line 106: | ||
==== E-mail Text Script ==== | ==== E-mail Text Script ==== | ||
- | < | + | < |
#!/bin/bash | #!/bin/bash | ||
Line 122: | Line 126: | ||
</ | </ | ||
+ | |||
+ | ===== Some Future Ideas ===== | ||
+ | |||
+ | * Have less hardcoded values in the script; customize variables that can be set or passed to the shell script during run. | ||
+ | * Add some additional options to the SQL query run: | ||
+ | * Use \t to output tuples instead of ugly hack with sed removing the row count. | ||
+ | * Make some components of the query into variables that can be passed via script. | ||
+ | * Perhaps consider moving the query as a saved view in the database | ||
scratchpad/automated_sql_reports.1304061540.txt.gz · Last modified: 2022/02/10 13:33 (external edit)