- Disk space: at least 3× the size of the
/var/www/nextcloud
directory is available on/var/backups
- Nextcloud is installed into
/var/www/nextcloud
as userwww-data
- AWS cli is installed and configured with credentials
mysqldump
is installedrsync
is installed
Create file /root/cron-env
with these contents:
HOME=/root
LOGNAME=root
PATH=/usr/bin:/bin
LANG=en_US.UTF-8
SHELL=/bin/sh
PWD=/root
Create executable file /root/run-as-cron
with these contents:
#!/bin/bash
/usr/bin/env -i $(cat /root/cron-env) "$@"
Create executable file /root/backup-nextcloud-to-s3.bash
with these contents.
0 5 * * * /root/backup-nextcloud-to-s3.bash
./run-as-cron /root/backup-nextcloud-to-s3.bash