syncthing-owncloud
syncthing-owncloud copied to clipboard
PHP occ question...
I know you haven't updated this project in a while and may no longer be working on it, but I can't seem to get the program to run the proper php line in the main.go files. I've tried multiple variations including just typing out the exact command directly but I don't know Go well enough to know what to put main.go line 98 in order to make this work. Any chance you could help? When I run php occ manually it works perfectly and the line reads: sudo -u www-data php /var/www/nextcloud/occ files:scan --path=admin/files
I tried: exec.Command("sudo -u www-data php /var/www/nextcloud/occ files:scan --path=admin/files/"+file)
But that didn't work. It plugged in the proper file but gave me a "no such file or directory" error. Any help would be appreciated thanks.
command line arguments are separated by comma in go (see https://golang.org/pkg/os/exec/#Command) so you need something like (untested)
out,err := exec.Command("sudo","-u","www-data","php", "-f",config.occpath,"files:scan","--path="+config.ocuser+"/files/"+file)
Thanks.