Skip to content

Rotate logs and backup database on deployed gateways#140

Merged
steventux merged 11 commits into
mainfrom
DTOSS-13124-rotate-gateway-logs
Jun 24, 2026
Merged

Rotate logs and backup database on deployed gateways#140
steventux merged 11 commits into
mainfrom
DTOSS-13124-rotate-gateway-logs

Conversation

@steventux

@steventux steventux commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

Rotate logs and backup databases on Windows VMs

Sets up a daily schedule to rotate logs at 2:30AM. 5 rotated logfiles for each service are retained.

Sets up a weekly schedule to backup databases every Sunday at 2AM. A default 5 backups are retained.

The PACS database backup also creates a zip archive of PACS directories and files from data\storage\* then deletes the contents of the directory. The zip is overwritten each time but this means we retain a week of PACS data + db.

Scheduled Tasks on Gateway VM

image

Jira link

https://nhsd-jira.digital.nhs.uk/browse/DTOSS-13124

Review notes

Best to review via RDP from the azure portal, you should see the scheduled tasks on the gateway and evidence of logs and db rotation.

Review checklist

  • Check database queries are correctly scoped to current_provider

@steventux steventux force-pushed the DTOSS-13124-rotate-gateway-logs branch from 0853e7f to e7afa66 Compare June 16, 2026 15:37
@steventux steventux force-pushed the DTOSS-13124-rotate-gateway-logs branch from e7afa66 to 393d846 Compare June 16, 2026 15:42
@steventux steventux force-pushed the DTOSS-13124-rotate-gateway-logs branch from 393d846 to a4a24c4 Compare June 16, 2026 16:03
@steventux steventux force-pushed the DTOSS-13124-rotate-gateway-logs branch from a4a24c4 to e728ea5 Compare June 17, 2026 07:57
@steventux steventux force-pushed the DTOSS-13124-rotate-gateway-logs branch 3 times, most recently from 3dcae60 to 032bff2 Compare June 17, 2026 16:55
@steventux steventux mentioned this pull request Jun 17, 2026
1 task
@steventux steventux marked this pull request as ready for review June 17, 2026 16:57
steventux and others added 7 commits June 24, 2026 11:20
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
carlosmartinez
carlosmartinez previously approved these changes Jun 24, 2026
@steventux

Copy link
Copy Markdown
Contributor Author

@carlosmartinez I have retested all 3 scheduled tasks on the review gateway VM and everything works as expected. I've pushed an additional commit to rename db backup function. Would you re-approve please?

@carlosmartinez carlosmartinez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steventux steventux merged commit 1bf2892 into main Jun 24, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants