Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCalvert committed Aug 21, 2024
2 parents c58d8fe + 98cca78 commit 8cf01ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ckan/Dockerfile.worker
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ COPY supervisor/ckan_*.conf /etc/supervisord.d
COPY supervisor/supervisord.conf /etc/supervisord.conf

## Cron jobs config
COPY setup/dbca_logs_maintenance.sql $APP_DIR
RUN chmod -x $APP_DIR/dbca_logs_maintenance.sql
COPY setup/dbca_ckan_cron_jobs $APP_DIR
RUN chmod -x $APP_DIR/dbca_ckan_cron_jobs
RUN crontab -u ckan $APP_DIR/dbca_ckan_cron_jobs
4 changes: 3 additions & 1 deletion ckan/setup/dbca_ckan_cron_jobs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
# 12:30am report generation for archiver broken links
30 0 * * * /usr/bin/ckan -c /srv/app/config/dbca.ini report generate >> /srv/app/logs/ckan-cron-jobs.log 2>&1
# 8am task to send CKAN email notifications
0 8 * * * /usr/bin/ckan -c /srv/app/config/dbca.ini notify send_emails >> /srv/app/logs/ckan-cron-jobs.log 2>&1
0 8 * * * /usr/bin/ckan -c /srv/app/config/dbca.ini notify send_emails >> /srv/app/logs/ckan-cron-jobs.log 2>&1
# Midnight dbca logs maintenance
0 0 * * * psql $CKAN_SQLALCHEMY_URL -f /srv/app/dbca_logs_maintenance.sql >> /srv/app/logs/ckan-cron-jobs.log 2>&1
5 changes: 5 additions & 0 deletions ckan/setup/dbca_logs_maintenance.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DELETE FROM "public"."dbca_logs"
WHERE to_timestamp("timestamp", 'YYYY-MM-DD HH24:MI:SS,MS') < NOW() - INTERVAL '30 days'
;
VACUUM "public"."dbca_logs"
;

0 comments on commit 8cf01ca

Please sign in to comment.