How to run "occ" tasks without access to the shell

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.6
  • Operating system and version (e.g., Ubuntu 24.04):
    • I don’t know, I don’t have shell access. I only know the kernel version: 4.18.0-553.54.1.el8_10.x86_64
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.63
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • I don’t know
  • PHP version (e.g, 8.3):
    • 8.3
  • Is this the first time you’ve seen this error? (Yes / No):
    • It’s not an error
  • When did this problem seem to first start?
    • It’s not a problem
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • web install
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • I don’t know

Summary of the issue you are facing:

I have a line in the admin panel suggesting to run a script through “occ”:

One or more mimetype migrations are available. Occasionally new mimetypes are added to better handle certain file types. Migrating the mimetypes take a long time on larger instances so this is not done automatically during upgrades. Use the command occ maintenance:repair --include-expensive to perform the migrations.

As I don’t have shell access I can’t perform any maintenance task involving “occ”.

I read here (OCC Web - Apps - App Store - Nextcloud) about an app that should solve the issue but I can’t understand if I can use it or not. That page says there is a release for NC 31 but the github page (GitHub - Adphi/occweb) says it’s deprecated. I also found some other posts but couldn’t understand what is the situation with this app.

Can I use this app?

If not, is there anything else that I can do to run “occ” scripts without having any shell access?

I’m running a personal installation of NC, I’m the only user and I have uploaded ten documents more or less.

Ciao,
Max

though the page itself says “deprecated” v 0.2.3 seems to be official and working, following the changed files on github.

though you should be aware that it can happen that the app won’t work correctly, depending on your setup.

Best suggestion is: do a backup. Then install said app and see how and if it works. If it’s doing its job, fine.
If you’ll face problems, deactivate (and maybe delete) it. If the app will cause major problems do a system-restore from your backup.

good luck and happy nc’ing
JK

NB: NC wasn’t made to run on shared services. you faced one of the problems that come up with doing it though :wink:

1 Like

Thanks for your suggestion.

I know NC wasn’t made to be run on shared services but it was made so well that I’m satisfied with it on a shared device also :slight_smile:

It also depends on the sepcific hosting plan. I mean, there are definitely shared hosting plans that offer shell access and allow you to run PHP scripts from the command line. Although it might still not be the ideal setup for all use cases, running Nextcloud on such a plan would definitely be more feasible.

1 Like

OCC Web worked like a charm (I leave this just in case someone needs to do the same thing).

Now I’ve disabled the app to avoid any malicious use.

Ciao,
Max

2 Likes