Do space-based VMU test run cleanup (SOFTWARE-5719)#269
Do space-based VMU test run cleanup (SOFTWARE-5719)#269brianhlin merged 8 commits intoopensciencegrid:masterfrom
Conversation
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>`.
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
|
An issue with this script is that it does not work properly unless |
They're on separate partitions so I think this'll be ok |
timtheisen
left a comment
There was a problem hiding this comment.
A high water mark of 90% is unrealistic. We know that a nightly run accumulated 49 GB before running out of space. So, 50 GB is approximately 20% of the /home partition. Ext4 reserves 5% of space for root/system. So, the highest that the high water can be is 75%. It's probably better to have some head room, perhaps 65%.
|
OK, water marks updated. |
Rewrite vm-test-cleanup to look at disk space on
/var/www/htmland/osgtest/runsand delete run directories based on that.