[Evergreen-general] [External] Reporter folder cleanup question
Blake Graham-Henderson
blake at mobiusconsortium.org
Tue May 28 15:29:06 EDT 2024
Jon,
Here's the cron line:
# purge 90 day old reports
0 01 * * * psql < purge_reports.sql >/dev/null 2>&1
And the contents of purge_reports.sql:
BEGIN;
DELETE FROM reporter.schedule WHERE run_time<NOW()-INTERVAL '90 days';
DELETE FROM reporter.report WHERE create_time<NOW()-INTERVAL '90 days'
AND recur=FALSE AND id NOT IN
(SELECT r.id FROM reporter.report r INNER JOIN reporter.schedule s ON
r.id=s.report);
COMMIT;
-Blake-
Conducting Magic
Will consume any data format
MOBIUS
On 5/28/2024 1:45 PM, Murphy, Benjamin via Evergreen-general wrote:
> NC Cardinal has a process that deletes old output and non-recurring
> reports after 3 months. We don't touch the templates. (Its a cron job
> that Mobius runs for us.)
>
> *Benjamin Murphy*
>
> NC Cardinal Program Manager
>
> State Library of North Carolina
>
> _benjamin.murphy at dncr.nc.gov _ |
> https://statelibrary.ncdcr.gov/services-libraries/nc-cardinal
>
> 109 East Jones Street | 4640 Mail Service Center
>
> Raleigh, North Carolina 27699-4600
>
> The State Library is part of the NC Department of Natural & Cultural
> Resources.
>
> /Email correspondence to and from this address is subject to the North
> Carolina Public Records Law and may be disclosed to third parties./
>
> Please note new email address
>
> ------------------------------------------------------------------------
> *From:* Evergreen-general
> <evergreen-general-bounces at list.evergreen-ils.org> on behalf of
> JonGeorg SageLibrary via Evergreen-general
> <evergreen-general at list.evergreen-ils.org>
> *Sent:* Tuesday, May 28, 2024 2:35 PM
> *To:* Evergreen Discussion Group
> <evergreen-general at list.evergreen-ils.org>
> *Cc:* JonGeorg SageLibrary <jongeorg.sagelibrary at gmail.com>
> *Subject:* [External] [Evergreen-general] Reporter folder cleanup
> question
> CAUTION: External email. Do not click links or open attachments unless
> verified. Report suspicious emails with the Report Message button
> located on your Outlook menu bar on the Home tab.
>
> What methodology are you all using to periodically purge old reports
> out of the /openils/var/web/reporter folder?
>
> Thanks
> -Jon
>
> ------------------------------------------------------------------------
>
> Email correspondence to and from this address may be subject to the
> North Carolina Public Records Law and may be disclosed to third
> parties by an authorized state official.
>
> _______________________________________________
> Evergreen-general mailing list
> Evergreen-general at list.evergreen-ils.org
> http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.evergreen-ils.org/pipermail/evergreen-general/attachments/20240528/c24f5072/attachment.htm>
More information about the Evergreen-general
mailing list