Cron job for purging files_trashbin not working


#1

Related to my other question on this forum:

I am running an instance of owncloud 9.1.4 in a hosted environment and just found out that something is broken with the purging of deleted files (and possibly also file versions).

The symptom is that I am running out of diskspace. This mostly due to bloated files_trashbin folders (more than 2GB), partially due to large ‘files_versions’ folders (several hundred MB) in the respective user folders.

I have edited config.php to enable shorter retention periods but so far, no improvement.

My log file has many entries similar to this:
{"reqId":"W4lLltTjdhcAAFsEOgcAAAAn","remoteAddr":"192.XX.XX.XX","app":"core","message":"Could not get application: cURL error 60: SSL certificate problem: certificate has expired","level":3,"time":"2018-08-31T14:07:19+00:00","method":"GET","url":"\/oc\/index.php\/settings\/apps\/list?category=enabled&includeUpdateInfo=1","user":"username"}
but I am not sure what this wants to tell me, neither how to fix it.

Any suggestions on how to fix the problem of files_trashbin and files_versions of filling up?
I could completely forgo the feature of old versions, if that makes it easier.

Thank you!


Old files do not get deleted
#2

Hey,

this looks quite outdated even for the end-of-life 9.1 branch. I would suggest to upgrade to the recent 10.0.9 version to see if the not working retention period was just a bug in older versions.


#3

OK, fair enough.
The problem is that my disk space is already filled up. Before I do anything new, I need to free up some space, and owncloud is occupying the vast majority of it.

I am hesitant to just delete the offending folders using FTP…


#4

BTW, I just found out that my owncloud instance also keeps hundreds of open sessions (User > Personal > Sessions), some over a year old!
Something central for cleaning up the system isn’t working, I guess?


#5

Hey,

that could be also a side affect of using an outdated version of ownCloud.


#6

I can confirm this. I also had many old “connections” remaining, mostly from cal- and/or carddav syncs on android devices. Gone with oc10. However, I’m sure if those connections were real, this would have ended up in some trouble with my provider. But now it’s OK,s so who cares? :wink:


#7

OK. So I went ahead and updated my 9.1.4 to 9.1.8 and then to 10.0.9 - but now…

… calendar and contacts are gone,

… most of the admin interface is gone…

The online help says “The Contacts, Calendar, and Mail apps are not included in ownCloud 9, and are not supported. You may easily install them by clicking the Enable button on their respective Apps > Productivity entries.” – but there are no Apps > Productivity entries

How do I get my contacts back?!


#8

Menue->Market, install contacts app.


#9

Great, thank you very much. For a moment, I was a little panicky…
It’s tricky when the documentation “looks” very complete and reliable but really isn’t.
That single line up there on the page about calendars and contacts would go a long way.

Thanks again, off to testing owncloud 10…


#10

FWIW, even after upgrading to 10.0.9 the problem of old data accumulating still persists


#11

Hey,

maybe your hosting provider is limiting the possibilities of ownCloud to see the actual used space on your package or providing wrong / too much space then actual left?


#12

That’s a good idea! The system might report free space of the entire server instead of my quota.
How would I be able to verify this, and if that is the case what could I modify in my owncloud installation to trigger the cleanup already at higher levels of disk space?

In config.php, I have the lines

‘versions_retention_obligation’ => ‘1,2’,
‘trashbin_retention_obligation’ => ‘1,2’,

which I thought would remove old stuff regardless of disk space?


#13

Hey,

maybe it could be also possible that this isn’t the correct syntax and you need to use something like:

'versions_retention_obligation' => 1,2,


Old files do not get deleted
#14

OK, I will try - but the documentation seems to suggest the quotes?
Also: shouldn’t I be seeing some error if the syntax is wrong?

Edit: The config.sample.php file that ships with owncloud suggests the need for quotes, too:

* Available values:
 *
 * * ``auto``
 *     default setting. keeps files and folders in the trash bin for 30 days
 *     and automatically deletes anytime after that if space is needed (note:
 *     files may not be deleted if space is not needed).
 * * ``D, auto``
 *     keeps files and folders in the trash bin for D+ days, delete anytime if
 *     space needed (note: files may not be deleted if space is not needed)
 * * ``auto, D``
 *     delete all files in the trash bin that are older than D days
 *     automatically, delete other files anytime if space needed
 * * ``D1, D2``
 *     keep files and folders in the trash bin for at least D1 days and
 *     delete when exceeds D2 days
 * * ``disabled``
 *     trash bin auto clean disabled, files and folders will be kept forever