Skip to content

Conversation

@matyasselmeci
Copy link
Contributor

@matyasselmeci matyasselmeci commented Dec 11, 2025

Rewrite vm-test-cleanup to look at disk space on /var/www/html and /osgtest/runs and delete run directories based on that.

Copilot AI and others added 3 commits December 10, 2025 18:24
Copilot, GPT-5 mini. Prompt was:

Write a script that cleans up old directories if we are running low on disk space.
Monitor the directory `/var/www/html`.  If the used disk space goes above 90%,
delete directories matching the pattern `<TIMESTAMP>`, where <TIMESTAMP> is in
the format `%Y%m%d-%H%M`; the oldest directory, based on timestamp, should be
deleted first. Directories should be deleted until used disk space goes below
85%. For each directory deleted, remove the corresponding directory matching
the pattern `/osgtest/runs/run-<TIMESTAMP>`.
@matyasselmeci matyasselmeci requested a review from a team December 11, 2025 00:48
@matyasselmeci matyasselmeci marked this pull request as draft December 11, 2025 00:53
Copilot AI and others added 2 commits December 10, 2025 18:58
Copilot, model GPT-5 mini. Prompt was:
Edit vm-test-cleanup to watch the space in and clean the directories
`/var/www/html` and `/osgtest/runs` separately; when deleting a directory from
`/var/www/html`, do not delete the corresponding directory from
`/osgtest/runs`.
- Directories in /osgtest/runs start with a prefix
- Fix comments and constant names
- Don't abort the whole script on some errors;
  return code is based on each dir
@matyasselmeci matyasselmeci marked this pull request as ready for review December 11, 2025 01:23
@matyasselmeci matyasselmeci marked this pull request as draft January 6, 2026 17:03
@matyasselmeci
Copy link
Contributor Author

An issue with this script is that it does not work properly unless /var/www/html and /osgtest/runs are on separate mounts (otherwise it will only delete from one and not the other). This may or may not be the case on the new AP, so I should fix the issue first.

@brianhlin
Copy link
Member

This may or may not be the case on the new AP, so I should fix the issue first.

They're on separate partitions so I think this'll be ok

@matyasselmeci matyasselmeci marked this pull request as ready for review January 6, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants