Hi @afluegel
There are good reasons not to do so.
Normaly one creates aliases for such tasks.
Create a file (if not yet exists) in your user directory
~/.bash_aliases
which is normaly sourced by your bash
(look if the file ~/.bashrc
contains this lines:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
)
and there you can enter it as an alias or even better (more stable) as a function:
NC_DIR='/var/www/nextcloud'
NC_USER='www-data'
occ() {
sudo -u $NC_USER -f "$NC_DIR/occ" "$@"
}
If you want to use it right away, you should source it in your actual terminal session:
source ~/.bash_aliases
(it will be sourced in your bash in future automaticaly)
Now you can simply work with “occ” from your terminal.
I created a → 0 configuration wrapper for occ ← which enables you to use occ out of the box, without messing around with user and/or execution bit. It is written for Ubuntu/Debian but if you install the dependencies first, it could be that it works.
I would be hapy to get feedback about that.
These are the dependcies: curl, gnu-gpg, jq and at least php-cli in case you are running Nextcloud All-in-One
Much and good luck,
ernolf