Package: autopostgresqlbackup For some reason (that is a topic out of scope here), I can not use 'su' on my server but 'sudo' works fine. I believe, it is also better security practice to use 'sudo' when it is available?
Maybe one could have a way to configure what way to use to run commands as a different user in /etc/defaults? A variable $RUNAS? $RUNAS $SU_USERNAME $COMMAND? But then $RUNAS probably needs to call a function that also needs to be defined in /etc/defaults? How about running the whole script as a specific user?