Use cool su instead of sudo

This commit is contained in:
exu 2023-07-21 13:17:01 +02:00
parent 474b817baa
commit f64d142177

View File

@ -122,13 +122,13 @@ systemctl restart apache2
To execute regular jobs, I personally use cron.
Edit `crontab` as the `www-data` user.
[shuser]
[shroot]
```sh
sudo -u www-data crontab -e
su -s /bin/sh -c 'crontab -e' www-data
```
[/shuser]
[/shroot]
Add this following line:
@ -180,25 +180,25 @@ Array of trusted domains.
Enable maintenance mode to prevent data inconsistencies
[shuser]
[shroot]
```sh
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on
su -s /bin/sh -c 'php /var/www/nextcloud/occ maintenance:mode --on' www-data
```
[/shuser]
[/shroot]
To disable maintenance mode again, run the same command with `--off` instead of `--on`
### Upgrade with CLI
[shuser]
[shroot]
```sh
sudo -u www-data php /var/www/nextcloud/updater/updater.phar
su -s /bin/sh -c 'php /var/www/nextcloud/updater/updater.phar' www-data
```
[/shuser]
[/shroot]
Always check the admin status page after an upgrade. Sometimes additional steps are needed to fully complete the upgrade
@ -206,13 +206,13 @@ Always check the admin status page after an upgrade. Sometimes additional steps
The missing indices can be added using `occ`
[shuser]
[shroot]
```sh
sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices
su -s /bin/sh -c 'php /var/www/nextcloud/occ db:add-missing-indices' www-data
```
[/shuser]
[/shroot]
### Backup Database