Using OCC How to invoke?

This is a general description of my server etc.

Unraid ver: 6.8.1

Nextcloud ver: 18.0.0 (latest)

Hardware: ASUS R710 server

Nextcloud apps: none except default

Unraid dockers: radar, sonar, nzbget, plex,mariadb, netdate (all latest versions)

Unraid VM’s: none

Array: 24Tb (7 Tb used)

I have moved some files from another source to my admin user directory in Nextcloud. The files do not show in Nextcloud. There are no other users besides my admin user in Nextcloud.

I have searched and it appears that OCC is the solution using filescan.

I have all of the syntax and commands information.

I have 1 simple question, after searching all of the posts:

How do you invoke/install OCC on the server??

This is the most direct reference I have found:

Using the occ command

Nextcloud’s occ command (origins from “ownCloud Console”) is Nextcloud’s command-line interface. You can perform many common server operations with occ , such as installing and upgrading Nextcloud, manage users, encryption, passwords, LDAP setting, and more.

occ is in the nextcloud/ directory; for example /var/www/nextcloud on Ubuntu Linux. occ is a PHP script. You must run it as your HTTP user to ensure that the correct permissions are maintained on your Nextcloud files and directories.

https://docs.nextcloud.com/server/18/admin_manual/configuration_server/occ_command.html?

All of the posts show there are a lot of “useful” commands in OCC . It also says you have to login as http user in order to use it. Is that under Unraid terminal or Nextcloud console?? Is it my Unraid user or Nextcloud user.

But, none of them show you how to invoke and/or install OCC – I must be stupid or something but I just don’t see this discussed anywhere.

Is OCC included under Nextcloud 18? Do I have to install it?

Don’t know where else to look??? If you need more info let me know.

Thanks in advance

1 Like

Not sure what your are after. Occ is part of the standard Nextcloud installation. From the link you provided:

occ is in the nextcloud/ directory; for example /var/www/nextcloud on Ubuntu Linux. occ is a PHP script. You must run it as your HTTP user to ensure that the correct permissions are maintained on your Nextcloud files and directories.

Well I have solved the problem. It was actually quite easy.

Now for those of you that have brain cramps like I did I will detail the solution - because I believe in helping users out when I can.

Just as a side note my post was viewed 11 times in 5 hours - not one response. Either the question was so dumb it didn’t rate a response or …
Anyway the solution was easy once you know:

  1. Go into your Nextcloud screen listing your files.
  2. Top right corner you see an icon usually having a colored circle with a letter (could be something
    else if you have customized).
  3. Click on it and a drop down menu is shown.
  4. Click on apps which takes you to where you can add apps to Nextcloud (take a look there are lots
    of them)
  5. Look for the app: OCC Web
  6. Install this app and then return to your default screen (files)
  7. There is a new icon in the top left:
    image
  8. Click this icon and it brings you to the OCC web prompt from there you can run all of those
    wonderful OCC commands.
  9. I ran: files:scan --all and took about 5 minutes for 36Gb
  10. All of the commands are laid out in this documentation:
    https://docs.nextcloud.com/server/18/admin_manual/configuration_server/occ_command.html#

If this helps just one person - then it was worth it.

PS: I did the documentation and when I went to post it - it says new users can only post 2 images. Never seen that before…seems a little Orwellian.

And I just got word that somebody has finally responded- Kudos

Cheers

15 Likes

Thanks RdedR.

My problem was how to actually get to an OCC prompt.

As you can see by my previous post I solved it with an app from the Nextcloud store.

Kudos to you for actually responding. There are some classy users out there thank goodness.

Cheers

1 Like

That is a way of doing it as long as you have access to the Nextcloud GUI. In some cases you won’t e.g. being locked up in maintenance mode or so. Then you can open the Linux Terminal and execute the Occ commands on the command prompt outside of Nextcloud.

Excellent! Good dialogue that takes the answer even further.

Didn’t know that. :smiley:

Cheers

Original POST by Paradox551
Look for the app: OCC Web

I just got on the forum and saw this thread but your solution is stupid and it’s understandable that people wouldn’t reply as it’s in the official nextcloud install guide.

OCC can be invoked as described in the official nextcloud guide here .

It works on a barebones install. If you are using docker or LXC you have to figure out how to send the commands through those applications. As a system administrator that is your responsibility as is security.

And that app? I wonder if you noticed it’s a third party app. There is a reason nextcloud developers don’t have an OCC terminal in nextcloud and it has nothing to do with possible security vulnerabilities

My response:

Wow angry much :open_mouth: . Obviously designed to start a flame war. Well I don’t do that - I prefer to educate.
Oh by the way I got this message when I logged in ((post withdrawn by author, will be automatically deleted in 48 hours unless flagged) I have included the original post just so we don’t forget about it. Admin tell you to take it down?

You don’t really understand the purpose of a help forum do you. The forum is HELP.netcloud.com . You are such a Paradox….

I feel a teaching moment is at hand.

A help forum is to help those who are either too new to the game or have a particular problem that they can’t solve. I do have to agree that some users may use it just to get an answer because they are too lazy to search.

It is not a personal forum for the Nextcloud gods to look down upon the great unwashed.

Let’s talk about why this is “stupid” – your words not mine –

Is it stupid because: A) You didn’t think of it B) because it was solved without the divine wisdom of an omnipotent Nextcloud god?

You say it can be found in the quoted Nextcloud Guide. If you had looked at my previous post I quote the same guide. My Nextcloud has one user – me.

Problem is that the Nextcloud guide, as with most “guides” is not designed for the noobie. It doesn’t do a step by step which is what most folks who visit HELP.netcloud.com are looking for, or maybe not ….anyone want to chime in?

I read this passage in the guide over and over and it still didn’t do it for me on the how.

I am no expert – just started out – much like you did a time ago – noobie just like me.

Third party app? So? It is in the Nextcloud Store so it must have passed some kind of checks to get there – don’t know.

Anyway enough of dissecting the post …… because there is so much more……

Let’s summarize:

  • Offered no new information
  • Called my solution “stupid”
  • Offered no explanations or help
  • Just berated the user
  • Arrogant and posts without thinking about it
  • Has forgotten the purpose of a help forum

Why don’t you calm down, provide some constructive feedback and remember that there are no bad questions on a help forum. Take a page from RdedR - offer help!

Oh, and could I suggest a little light reading or even better a movie? It might change your life.

https://www.imdb.com/title/tt10011682/

2 Likes

I have included the original post just so we don’t forget about it. Admin tell you to take it down?

Nope! It was late and I was drunk.

Still stand by what I said. occ is listed in the nextcloud documentation and you should have been able to figure this out without asking for help from the community.

If you can’t figure out occ or read the documentation you likely can’t secure your server so I’m not sure if you should be running nextcloud but that’s none of my business.

I do like how you said my post was to start a flame war and yet you replied to it despite deleting it!

The documentation does not cover docker or LXC if that is what you are using. That’s because it’s not a nextcloud issue.

And since I know how these kind of posts go that’s my last response to you.

Hey there,

Thanks for the research and posting, it really did help me trying to figure out why my listed files did not match what was on my NAS.

I really appreciate it.

1 Like

Brilliant post. Thank you. This could have taken weeks to figure out without your help. Phrases like You must run it as your HTTP user mean nothing to me. Can’t understand why this is not explained by the development team.

Having said all that, I’m still really excited to be starting using nextcloud. It looks like a great project and as I’m getting thousands of person hours of sofware for free, I shouldn’t complain too much :slight_smile:

2 Likes

I did not write the documentation but if I had to guess, I’d say the reason this isn’t explained by the documentation is because it’s sort of assumed that if you’re trying to set up a piece of software like Nextcloud, you already know it and if you don’t you’d have bigger problems - like not having the skills to diagnose Nextcloud when it breaks, or not being able to properly secure the server. The internet and production server are dangerous places and if you run something in production on the internet you inherently have to have some sort of baseline skill level in order to be able to deal with that danger.

To be clear, that’s not a knock on anybody trying to learn - we all start somewhere, myself included. It’s just an observation on the inherent tradeoff of running something on the internet. I’m not trying to discourage you, just saying to be careful :slight_smile:

Now to answer your specific question, “HTTP user” refers to the Unix system user the HTTP server (for example, Apache 2 or Nginx) is running under. On Debian-like systems, for example, this is typically www-data. It has nothing to do with Nextcloud users.

Hi,

Alas, I still don’t know how to get the terminal. I did use OCC web before, like the OP suggested, but now it’s depreciated.
My Nextcloud installation is on a host server, I don’t have access to it unless through the web.

I read the help-pages about OCC but didn’t find an explanation how to get to the OCC. I see the occ file in my NextCloud (with ftp) and tried things like “www.mydomain.be/nextcloud.occ” but that doesn’t work.
BTW: I also didn’t know what “HTTP user” meant. I use Nextcloud for 3 years now, without ever missing that knowledge.

Much appreciated!
I just transitioned from ownCoud to nextCloud and have spent most of the day trying to update my file directory. Kudos to you for this post!

As a noob unable to understand what I am doing, here is how I managed to invoke occ to run the command db:convert-filecache-bigint

Open a terminal window on the Debian server running Nextcloud.
Act as root (you must know the root password).
eiffel@server:~$ su
Go to where occ is.
root@server:/# cd /var/www/html/nextcloud/
Run the occ command as http user (www-data in my case).
root@server:/var/www/html/nextcloud# sudo -u www-data php occ db:convert-filecache-bigint
When it is done, go back to normal user.
root@server:/var/www/html/nextcloud# exit

1 Like

Or you could just do su -u www-data php occ db:convert-filecache-biginit.

I believe www-data is the user name that is a default on most linux installations. Make sure this is the owner for your system. On bsd based systems the owner is www:www and I believe its different on a few linux systems as well.

You are right, but I could not go this way because user eiffel is not a sudoer.

@Eiffel – You’re totally right on that point. I didn’t consider the user you were referencing didn’t have su rights.

It is my belief that this is the ONLY place in the world where this information is located.
I’ve noted that the usage instructions for ANY of the Nextcloud apps is EXTREMELY limited.

THANK YOU, just seams MUCH too inadequate for your contribution.

1 Like

I had to join the community to shake your hand!!! I’ve been tearing my hair out trying to figure out how to make the occ work in Unraid. Thank you for taking the time to give such a detailed explanation - much appreciated!

2 Likes

Yep same here… I couldn’t find any details about how to run occ in Docker on Unraid… after using Spaceinvader’s incredibly good tutorials for installing Nextcloud a long while back, my version was very outdated, so I started updating it only to see the need to run various occ fixes manually.

But when trying to run the commands from Unraid terminal, I couldn’t remember what the the user is supposed to be… so back to Spaceinvader’s tutorials, which revealed that he used the user “abc”… but that quickly resulted in errors saying that “abc is not in the sudoers file.”… doh!

But then some additional searching brought me to this link and the quick post using OCC Web which was an excellent solution. I mean seriously I can easily disable the plugin once I’m done, but this got it done efficiently!

Hopefully the keywords I’ve dropped in my response will help others find this more quickly!

As another apprecieative Nextcloud user on Unraid (via Docker), Kudos to @toolmanz for sharing his insights above!!!