I finally managed to properly mirror my main dokuwiki installation on a VPS (as a backup). Let me know if anything's wrong.
First my scenario is:
- main server is an ARM single-board-computer on my home ADSL internet connection (low traffic, https)
- main backup is on my desktop
- backup server is a cheap VPS with the same linux installation as the main server
- the backup server is just backup, I use and edit only the main server
- farm setup
- dokuwiki directories are owned by www-data and 755 644
- no root or sudo when using rsync, pubkey authentication via ssh
I get my desktop backup as a regular user with:
rsync -a --delete-delay server-url:/var/www/dokuwiki .
This is an exact copy of what's on the server but ownership is lost since I don't run rsync as root.
On the VPS I keep a copy of the desktop backup with:
rsync --delete-delay -a -i --exclude='*/data/cache/*' dokuwiki vps-url:
It's in the home directory of a regular user (still not using root) so to sync the VPS I copy it to the document root with:
sudo cp -a dokuwiki /var/www/html/
Last thing I do is adjust ownership:
sudo chown -R www-data:www-data dokuwiki
That's not too simple nor straightforward but it works. Any advice on a better workflow?