-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prune old Time Machine backups from the back end #22033
Comments
We should have a config option called: with a default of 90. We should delete timemachine snapshots older than the configed number of days. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I think this will be helpful |
support ticket https://dotcms.zendesk.com/agent/tickets/115354 |
…lders olders than PRUNE_TIMEMACHINE_OLDER_THAN_DAYS
…28530) This is a first PR for #22033 Proposed Changes Create a Util method to prune old time TimeMachine folder https://github.com/dotCMS/core/pull/28530/files#diff-5d7a647e09c3a207a6c502bdb945879b865d3dc8ad0cd7cc8c3b4fa233edd3aeR36 Checklist Tests Additional Info Later, I am going to create a Job to call this method every week
This is a second PR for #22033 First one: #28530 ### Proposed Changes * Create the Job class https://github.com/dotCMS/core/pull/28564/files#diff-ad7f5fa58328ce7220001bad020c4f3d203dcf182ff280b694f640179483b570R23 ### Checklist Tests ### Additional Info Later, I am going to send more changes to start and stop this Job
This is a third PR for #22033 First one: #28530 Second one: #28564 ### Proposed Changes - Create the getAvailableTimeMachineFolder Method https://github.com/dotCMS/core/pull/28574/files#diff-5d7a647e09c3a207a6c502bdb945879b865d3dc8ad0cd7cc8c3b4fa233edd3aeR53 - I realized that the TomeMachine Job created the folder with the "tm_" preffix instead of "timeMachineBundle" preffix, so I have to update all the test: https://github.com/dotCMS/core/pull/28574/files#diff-5ec720d6f4deb8a5228aee22286a6bbf3103289becc6d1fa4947017c9052f935L66-R151 https://github.com/dotCMS/core/pull/28574/files#diff-f27467cb9919462f8c7c5a137c3c9b9bf21be349047c0d1e1ba9315773e53298L43-R59 - Turn the "tm_" preffix into a Constant https://github.com/dotCMS/core/pull/28574/files#diff-19b28e2982b6db869240fb8fc96a2bf2c156e3607f41656fd16d7845c45ba604R37 and use it to create a FileFilter https://github.com/dotCMS/core/pull/28574/files#diff-19b28e2982b6db869240fb8fc96a2bf2c156e3607f41656fd16d7845c45ba604R245-R251 - The notRemoveNotTimeMachineFolder test was wrong because the "TIMEMACHINE_PATH" property was not being set on the test: https://github.com/dotCMS/core/pull/28574/files#diff-f27467cb9919462f8c7c5a137c3c9b9bf21be349047c0d1e1ba9315773e53298R132 ### Checklist - [x] Tests ### Additional Info Later, I am going to use this method on the [PruneTimeMachineBackupJob.java](https://github.com/dotCMS/core/pull/28564/files#diff-ad7f5fa58328ce7220001bad020c4f3d203dcf182ff280b694f640179483b570) to know when it need to be stopped, this job should be started when the TimeMachineJob is started and should be finished after the TimeMachineJob is stopped and no more Time Machine Folder are pending to be cleaned up
This is a last PR for #22033 First one: #28530 Second one: #28564 third one: #28586 On this PR we are starting the PruneTimeMachineJob, this need to be starter when the TimeMachineJob is started. ### Proposed Changes * Start the Prune Time machineJob after start the TimeMachineJob https://github.com/dotCMS/core/pull/28586/files#diff-d6eb70242764e7e3dbcffc3d0bac20c485b0879b72118925714bb30e37d1ac9aR507 * We need to remove the files under the bundle folder too https://github.com/dotCMS/core/pull/28586/files#diff-19b28e2982b6db869240fb8fc96a2bf2c156e3607f41656fd16d7845c45ba604R231 When TimeMachine run it created the Bundle folder under the bundles folder and later copy it to the timemachine folder, we need to remove both ### Checklist - [x] Tests - [ ] ### Additional Info Later I am going to sent a last PR with the Stop logic --------- Co-authored-by: Daniel Silva <daniel.silva@dotcms.com>
PR: #28586 |
Include logging of backups deleted
Passed Internal QA: Job properly deleting backups older than the specified number of days. |
Approved: Tested on trunk_f28fc49, Docker, macOS 13.0, FF v124.0.2 |
This is a last PR for #22033 First one: #28530 Second one: #28564 third one: #28586 On this PR we are starting the PruneTimeMachineJob, this need to be starter when the TimeMachineJob is started. ### Proposed Changes * Start the Prune Time machineJob after start the TimeMachineJob https://github.com/dotCMS/core/pull/28586/files#diff-d6eb70242764e7e3dbcffc3d0bac20c485b0879b72118925714bb30e37d1ac9aR507 * We need to remove the files under the bundle folder too https://github.com/dotCMS/core/pull/28586/files#diff-19b28e2982b6db869240fb8fc96a2bf2c156e3607f41656fd16d7845c45ba604R231 When TimeMachine run it created the Bundle folder under the bundles folder and later copy it to the timemachine folder, we need to remove both ### Checklist - [x] Tests - [ ] ### Additional Info Later I am going to sent a last PR with the Stop logic --------- Co-authored-by: Daniel Silva <daniel.silva@dotcms.com>
Is your feature request related to a problem? Please describe.
Time Machine backup files are saved indefinitely. Over time they can consume a substantial amount of disk space.
I believe the only way to remove these files from the dotCMS backend is to delete a Time Machine backup job, which will delete all backups for that job.
Otherwise, pruning old Time Machine files requires direct access to the file system.
Describe the solution you'd like
A couple suggestions:
The text was updated successfully, but these errors were encountered: