Installed NC19 snap, cant run occ - solved

Ubuntu 18.04, installed Nextcloud 19 snap – everything fine
want to do bulk upload of files
scp’ed files into /var/snap/nextcloud/common/nextcloud/data/USERNAME/files
everything is owned by root user
from regular user ran: sudo -u www-data php occ files:scan --all
got: sudo: php: command not found

found php and occ at following location

from regular user ran: (just trying to get occ to respond with help info)

sudo -u www-data /snap/nextcloud/22327/bin/php /snap/nextcloud/22327/bin/occ -h

/snap/nextcloud/22327/bin/php: error while loading shared libraries: cannot open shared object file: No such file or directory

Help !!

what is the right way to run occ on a snap??

root@machinename:/snap/nextcloud# nextcloud.occ files:scan --all

Yeah, there are several CLI utilities exposed by the snap, including occ. They are documented here: