You can use the dir you want, /home/admin/bin/, /usr/local/bin/, etc. but if those scripts must be run as root instead of admin, i. e. you must use sudo to run those scripts, then the scripts must be located here /usr/local/hestia/bin/
That’s because user admin is only allowed to use sudo with scripts located in that dir:
$ cat /etc/sudoers.d/admin
# Created by hestia installer
Defaults env_keep="VESTA"
Defaults env_keep+="HESTIA"
Defaults:admin !syslog
Defaults:admin !requiretty
Defaults:root !requiretty
# sudo is limited to hestia scripts
admin ALL=NOPASSWD:/usr/local/vesta/bin/*
admin ALL=NOPASSWD:/usr/local/hestia/bin/*
Is it possible to run a cronjob from the admin user like the following or does it require special permissions?
doveadm -v expunge -u [email protected] mailbox Junk before 30d
If you want to use doveadm to manipulate user’s mailboxes, then you must be root and to do so using admin user you should create a script with those doveadm commands and put the script in /usr/local/hestia/bin/ then you can call it from admin’s cron job using sudo /usr/local/hestia/bin/YourScript
You can always create the cron jobs directly under user root but that will be out of Hestia’s scope.