Managing files via CLI

How safe is it to manage files via occ? And manage permissions? Can you update a folders group share via occ or only via the GUI?

What do you mean by “safe”?

Whatever command is offered by occ uses the same backend as the GUI.

I managed to bork things up some months back, and was able to recover using a SnapShot (instance hosted on Vultr). To quicken things, I used sftp to re-upload the differences in files for the users, once they were re-created.

Once done, I scanned and updated the file database. However recently, I had a case of a share folder was not visible to one of the group members. I found that the file/folder permissions were incorrect, and corrected them via the back end cli (ubuntu 18.04). Rescanned to update the NC database and all seemed fine until discovery that a single folder wasn’t visible. I had to unshare / reshare that folder via the GUI to correct it.

Did I do this in the correct manner - or should it have been done differently to protect the db and permissions?

Not sure - it sounds like you restored an older snapshot, updated files but not the database? That would mean all changes (like new shares, calendar entries, etc) that are only stored in the DB would be lost.

Apart from that: make sure all files belong to your webserver user.