OCC examples for creating External Storages

Hi,

Simple one

I now want to create external storage mounts via occ, but cannot find any examples

e.g

files_external:create [–user [USER]] [-c|–config CONFIG] [–dry] [–output [OUTPUT]] [–] <mount_point> <storage_backend> <authentication_backend>

I can setup via GUI, but want a quicker way

here is the output from export below, so i could use import method, but figured the create occ line would be better

“mount_id”: 6,
“mount_point”: “Joes_Folder”,
“storage”: “\OCA\Files_External\Lib\Storage\SMB”,
“authentication_type”: “password::logincredentials”,
“configuration”: {
“host”: “192.168.0.1”,
“share”: “SharedFolders”,
“root”: “Common”,
“domain”: “mydomain”
},
“options”: {
“encrypt”: true,
“previews”: true,
“enable_sharing”: false,
“filesystem_check_changes”: 1,
“encoding_compatibility”: false
},
“applicable_users”: [
“joe”
],
“applicable_groups”: []
},

Does anybody have any examples, or could they help me contruct one ?

Thanks

So worked it out, what threw me was that it couldn’t be done in one command…

essentially I had to create the mount, then make it applicable to users…

e.g below

sudo -u www-data php /var/www/nextcloud/occ files_external:create Joes_Folder ‘smb’ password::logincredentials -c host=192.168.0.1 -c share=SharedFolders -c root=Common -c domain=mydomain

this then gave me mount id 3

sudo -u www-data php /var/www/nextcloud/occ files_external:applicable --add-user Joe 3

Hope this helps others out there :wink:

ZT

4 Likes