Old versions not being deleted - CRON job not running

Login to ownCloud as admin, disable the versions app. Panel Settings->Apps.
If the versions won’t be deleted that way, I’d remove them as you suggested.

But I’d prefer to fix the cron issue first.

When I went to Settings → Apps earlier today it was a completely blank page with a single button “Show disabled apps”.
I’ve tried again and got the same. I wish I had taken a screenshot.
I clicked the button and all the apps appeared: both enabled and disabled.
I have disabled the Versions app as a temporary measure in the hope it stops creating duplicate files otherwise this server will crash soon …44/50GB used.
oc4

OK, then delete the version files via cPanel, to get room.

Thanks.
oc5

That’s a lot safer now.
I’ve paused the client again because it is uploading files that haven’t changed (8GB).
I think that, on Monday, I will delete the sync connections from the clients and re-make everything.

I have no idea what to do about the CRON job.

Thanks for your time today - it’s much appreciated

1 Like

Anyway, I still recommend to disable versions app on ownClouds app panel, at least until the issues are fixed.

Thanks. I did it earlier

My hosting provider will not write the cron job for me.
So I have tried several variants as follows:
/usr/local/bin/ea-php74 /data01/NAME/ownclouddata/occ system:cron
Response: Could not open input file: /data01/NAME/ownclouddata/occ
/usr/local/bin/ea-php74 /data01/NAME/public_html/owncloud/cron.php
Response:

Your Data directory  is invalid
Please check that the data directory contains a file ".ocdata" in its root.

Cannot create "data" directory
This can usually be fixed by <a href="https">giving the webserver write access to the root directory</a>.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /data01/NAME/public_html/owncloud/lib/private/Console/Application.php:139
Stack trace:
#0 /data01/NAME/public_html/owncloud/console.php(115): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /data01/NAME/public_html/owncloud/occ(11): require_once('/data01/NAME/pub...')
#2 {main}

/usr/local/bin/ea-php74 /data01/NAME/public_html/owncloud/occ system:cron
Response: as previous response
/usr/local/bin/ea-php74 /data01/NAME/public_html/owncloud/occ system:cron
Response: as previous response

I installed oc via cPanel and Softaculous.
I made no changes during the installation - it must be as near a ‘standard’ install as possible.

Doesn’t the installation of oc cause a cron job to be created?
If so, why isn’t it working? What do I need to do to fix it?

Please, verify the cron job runs with the apache user (www-data, apache, httpd…).
If it’s running with a different user, it makes sense that the script can’t access to the data directory. Note that adding additional permissions to the folder might cause issues in the long run.

Thank you for your help.
I do not have much/enough understanding of this area so - please factor that in.

verify the cron job runs

I’m choosing my words very carefully here. I think the cron job runs because I get a confirmation email from the server telling me it has run. The trouble is the that the cron job has not been ‘written’ correctly.

For example, this cron job (“NAME” is a placeholder for the organistion)

/usr/php -f /data01/NAME/owncloud/occ system:cron

results in an email containing the message

/usr/local/cpanel/bin/jailshell: /usr/php: No such file or directory

whereas this cron job

/usr/local/bin/php -f /data01/NAME/ownclouddata/occ system:cron

results in an email containing the message

Could not open input file: /data01/NAME/ownclouddata/occ

I’m afraid I do not understand your request to:

verify the cron job runs with the apache user (www-data, apache, httpd…

I am using cPanel and do not appear to have terminal access.
As you probably now realise, I do not have much experience of this environment

I’m closing this now.
I don’t have a working cron solution.
I have turned off OC’s versioning ‘feature’. It hasn’t worked since installation which is a shame as there are simple freeware backup utilities that handle it well.
I have managed to get the sync working again between the two PCs and the server.
I have no idea why OC decided to upload all files to the server (even though they haven’t changed).
So I’ve used several GB of bandwidth (and energy) for no purpose.

Thanks to everyone who tried to assist me.

This is important. The combination of

  1. Shared hosting (no occ if no ssh)
  2. Cron not working properly
  3. Versions enabled by default

quickly leads to possibly huge data buildup (versions and trash folders). Can we try to solve this? The proper way would be getting cron to work, but maybe a workaround/best practice is also a way to handle the situation.

1 Like

What do you mean with:

Settings > Apps > Versions: Deactivate

If > Settings > Cron is set to “Cron” as recommended (and shown in post #1) it never runs, at least not in my installs (on shared hosting). This means trash and versions never get a cleanup; this is a problem we should try to tackle.

You don’t have any cron option from your hoster? Some allow running php scripts, then you can switch to “webcron”, even if it is not recommended.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.