Re: [Evergreen-general] [External] Reporter folder cleanup question

2024-05-28 Thread JonGeorg SageLibrary via Evergreen-general
Thank you everyone. This helps a ton. -Jon On Tue, May 28, 2024 at 12:48 PM Jason Stephenson via Evergreen-general < evergreen-general@list.evergreen-ils.org> wrote: > I hit reply too soon! > > We also run this a few minutes later to remove empty directories: > > find /openils/var/data/reports/

Re: [Evergreen-general] [External] Reporter folder cleanup question

2024-05-28 Thread Jason Stephenson via Evergreen-general
I hit reply too soon! We also run this a few minutes later to remove empty directories: find /openils/var/data/reports/ -empty -type d -delete You could bundle them up into a single script. I recommend running the above find command after the one in the previous email. On 5/28/24 15:46,

Re: [Evergreen-general] [External] Reporter folder cleanup question

2024-05-28 Thread Jason Stephenson via Evergreen-general
Jon, We run something similar to what Blake shared below. We also run this daily via crontab to remove the files after 90 days: find /openils/var/data/reports/ -type f -mtime +90 -delete You'll need to adjust "/openils/var/data" for wherever your reports are stored. HtH, Jason Stephenson

Re: [Evergreen-general] [External] Reporter folder cleanup question

2024-05-28 Thread Blake Graham-Henderson via Evergreen-general
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_timeDELETE  FROM reporter.report WHERE create_timeAND recur=FALSE AND id NOT IN (SELECT r.id FROM

Re: [Evergreen-general] [External] Reporter folder cleanup question

2024-05-28 Thread Murphy, Benjamin via Evergreen-general
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.mur...@dncr.nc.gov |