core icon indicating copy to clipboard operation
core copied to clipboard

Removing all old file versions

Open boschma1 opened this issue 11 years ago • 20 comments

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 avatar Jan 10 '15 08:01 boschma1

@boschma1 Thanks for this request. I think a command line option is the way to go here.

MorrisJobke avatar Jan 10 '15 11:01 MorrisJobke

This needs to be developed.

MorrisJobke avatar Jan 10 '15 11:01 MorrisJobke

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?

ghost avatar Jan 10 '15 11:01 ghost

@RealRancor Was this available as a button in the settings or as a config option?

MorrisJobke avatar Jan 10 '15 11:01 MorrisJobke

@MorrisJobke IIRC it was a button "Expire all" within the personal page of each user

ghost avatar Jan 10 '15 11:01 ghost

CC @schiesbn

PVince81 avatar Jan 12 '15 10:01 PVince81

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.

chemnic avatar Jan 16 '15 14:01 chemnic

expiry should be done via cron - @icewind1991 FYI - let's move this to the command bus - THX

DeepDiver1975 avatar Mar 02 '15 11:03 DeepDiver1975

Moving this feature "manual cleanup of versions" to 8.2 as we're past feature-freeze.

PVince81 avatar Apr 23 '15 11:04 PVince81

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 avatar Apr 23 '15 11:04 DeepDiver1975

@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.

PVince81 avatar Apr 23 '15 12:04 PVince81

And if there is a cronjob you still couldn't expire ALL old versions or am i wrong?

ghost avatar Apr 23 '15 13:04 ghost

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.

PVince81 avatar Apr 23 '15 13:04 PVince81

Sure, but sometimes you want to expire all versions without using any algorithms. And from my PoV the OP is exactly asking for this.

ghost avatar Apr 23 '15 13:04 ghost

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.

PVince81 avatar Apr 23 '15 13:04 PVince81

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?

DeepDiver1975 avatar Apr 23 '15 13:04 DeepDiver1975

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.

PVince81 avatar Apr 23 '15 13:04 PVince81

With "expiry" you are probably talking about the thinning out algo (not deleting all versions).

yes

DeepDiver1975 avatar Apr 23 '15 13:04 DeepDiver1975

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).

ghost avatar Apr 23 '15 18:04 ghost

8.2 will come with a CLI tool to remove all versions, see https://github.com/owncloud/core/issues/9652

PVince81 avatar Sep 21 '15 13:09 PVince81