Script ownCloud Client for Mac?

Hi all,

I have a setup where I can predict / already have all the information I need upfront to configure the client:

  1. serveraddress;
  2. username;
  3. password;
  4. shares to sync
  5. etc.

Is there a way to automate / script the client config?

I can find the owncloud.cfg, but that doesn't seem to hold all the information.

Any pointers in the right direction?

Kind regards,

safi78

Run Keychain Access.app (installed by default) to find the user/password. You might be able to create an entry from scripts.. https://apple.stackexchange.com/questions/170431/accessing-keychain-access-from-terminal-osx

Thanks,

Then now I'm only after the folder mappings, any idea where they are stored?

see the config files located in $HOME/Library/Application Support/ownCloud on MacOSX, details here: https://doc.owncloud.org/desktop/2.2/advancedusage.html#configuration-file

Hi guys,

Ok, really helpful stuff, thanks!

The only thing I can't figure out is how to manipulate (and store) the folder mappings.

All the other settings are found in either KeyChain or the owncloud.cfg.

Is there an easy way to configure meantioned folder mappings command liine for a user?

regards,

Sander

Hi Safi!

the folder mappings are also stored in the owncloud.cfg file; just create some with the GUI to see how it works. Once you have logged an account and created a few, some new lines appear under the [Accounts] section of the config file. Take a look at this example:

0\Folders\1\ignoreHiddenFiles=true
0\Folders\1\localPath=/Users/you/Desktop/local_folder1/
0\Folders\1\paused=false
0\Folders\1\targetPath=/remote_folder1
0\Folders\2\ignoreHiddenFiles=true
0\Folders\2\localPath=/Users/you/Desktop/local_folder2/
0\Folders\2\paused=false
0\Folders\2\targetPath=/remote_folder2
0\General\CaCertificates="[...]"
0\authType=http
0\http_certificatePasswd=
0\http_certificatePath=
0\http_user=admin
0\serverVersion=9.1.1.3
0\url=https://your.owncloud.server
0\user=admin

Each set of these 4 lines:

U\Folders\N\ignoreHiddenFiles=
U\Folders\N\localPath=
U\Folders\N\paused=
U\Folders\N\targetPath=

represents a different folder mapping (the one with sequence number N; unique for the system, assigned from 1 onwards) for the user U (unique system id for the user too, assigned from 0 onwards) the parameters, as you can guess, mean:

  • ignoreHiddenFiles wheter the hidden files under this folder are synced or not
  • localPath the local-side of the mapping (a folder on your system)
  • paused if the sync is paused / not
  • targetPath the remote path on the server

So, knowing this, It shouldn't be hard to create a script to manage easily these mappings. However, it's really easy to mess up, so be careful!

Best!

1 Like

Awesome, thanks, just what I was looking for.

Weird thing is, I tried that (use the GUI to see how the owncload.cfg changes) but I must have missed this somehow.

I'll test this and be very careful :wink:

Thanks a lot!

Did you have any success with this, just out of curiosity?

Actually, yes.

For a big project (about 2000+ users i think) we prepare a csv-file which basically is a matrix of username versus 'group'-folders.

I cooked up a script that reads out the csv, determines the folders it should have setup, puts all the relevant information in the config file. Testing it in the real world tommorow!

Thanks for all the help :slight_smile:

1 Like

Testing it in the real world tommorow!

Awesome! Really interested to see how those test turn out! :smiley: