- Disk space: at least 3× the size of the
/var/www/nextclouddirectory is available on/var/backups - Nextcloud is installed into
/var/www/nextcloudas userwww-data - AWS cli is installed and configured with credentials
mysqldumpis installedrsyncis 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=/rootCreate 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