Switch ownCloud (client) users from command line

For our student association, we are considering to introduce ownCloud for file management.

Currently, we are running a very complex samba setup and using network shares (mounted via custom logon script)

1.) per user
2.) different shares for all users in a certain group (e.g. financial, webmaster, …)

This is difficult to maintain and overly complex, especially since people started using their own Dropbox folder just to be able to share files faster externally.

We thus set up ownCloud 9 with LDAP backend, and groups etc are working just fine.

However, we would now like to automatically switch the user in the owncloud client at startup (so that files which aren’t supposed to be seen by everyone get deleted/hidden, and the user’s own files appear in the local folder).

I tried using a custom batch file that deleted everything except the common folder, but I couldn’t get the sync to start all over (using owncloudcmd), since this will only run one synchronization run, so once a user changes their files they won’t be synchronized.

Answer

It is strongly recommended to do this on the server and mess with the file on the Desktop. The best way is to mount the network shares automatically for the users in a way it fits the permissions. Please use Nextcloud instead of ownCloud because it is more actively developed and has all the features for free that you have to pay for at owncloud. Nextcloud has powerfull commands that can be used to automatically mount the storage for the users. Please see here: https://docs.nextcloud.com/server/10/admin_manual/configuration_server/occ_command.html#files-external-label

Attribution
Source : Link , Question Author : Zahlii , Answer Author : Darwiche

Leave a Comment