Removing all old file versions
Hi there
I am looking for a way to optimize my storage capazity. In my current setup I have about 4.7 GB of data in my owncloud, whereas my linux machine tells me that 147 GB of data are stored in the owncloud directories. I assume that is because of all the old file versions which is absolutely fine.
But I wish to delete all the old file versions and keep only the current ones. So, I am looking for a feature that lets me clean up all my versions of all files (or by directory) at once. I read about this problem in the forums and they advised to delete all the files_versions folders of all users and then go to some cache db using phpadin and deleting all the entries that pointed to the old versions - for me this is not an option.
Please advise. Thank you.
@boschma1 Thanks for this request. I think a command line option is the way to go here.
This needs to be developed.
Btw. there already was such a feature "expire all" available in older OC versions (OC5 IIRC). Seems this got removed with the new versioning system?
@RealRancor Was this available as a button in the settings or as a config option?
@MorrisJobke IIRC it was a button "Expire all" within the personal page of each user
CC @schiesbn
This is similar to my issue #13117, which I think is a bug. But this one is a feature request that could solve my problem.
expiry should be done via cron - @icewind1991 FYI - let's move this to the command bus - THX
Moving this feature "manual cleanup of versions" to 8.2 as we're past feature-freeze.
Moving this feature "manual cleanup of versions" to 8.2 as we're past feature-freeze.
is this manual mode really required? with 8.1 we have the background job taking care of this. I vote for close
@DeepDiver1975 it depends on how we understand "background cleanup". In the previous version, the versions cleanup was triggered by modifying the file (and maybe also querying the versions list). In the new version, doing so will schedule the background job to run one single cleanup pass for that specific file.
There is currently no global cron job that will automatically scan all version files everywhere and expire old ones. I think the latter is what was expected by @boschma1.
And if there is a cronjob you still couldn't expire ALL old versions or am i wrong?
If there was a cronjob, expiring all versions would require iterating over ALL the files which could become expensive. But also with "expiring" we mostly mean "thinning out" based on the algo described here https://doc.owncloud.org/server/8.0/user_manual/files/version_control.html.
Sure, but sometimes you want to expire all versions without using any algorithms. And from my PoV the OP is exactly asking for this.
It depends what you mean with "expire". If you mean "delete ALL versions for all files" (without thinning algo), then it would be easier because all files are in the "files_versions" subdir for every user.
Triggering a "global" expiry which takes into account all users and all files of the users - this can be a time consuming task. More something for the console?
With "expiry" you are probably talking about the thinning out algo (not deleting all versions). Then yes, maybe an "./occ versions:expire" that will take its time to go through all user's homes and expire versions using the thinning algo.
With "expiry" you are probably talking about the thinning out algo (not deleting all versions).
yes
Just quoting the OP:
But I wish to delete all the old file versions and keep only the current ones. So, I am looking for a feature that lets me clean up all my versions of all files (or by directory) at once.
This means no "expiry" but a "delete all versions" (cleaning up the complete files_versions folder).
8.2 will come with a CLI tool to remove all versions, see https://github.com/owncloud/core/issues/9652