You can run rclone from termux on android so you could use that as part of a solution.
pkg install rclone
Then you'll find your photos in storage/dcim/Camera
So you can run a script like this
#!/bin/bash
# backup photos
DEST=remote:phone_backup
rclone sync --fast-list --exclude ".thumbnails/**" -P ~/storage/dcim ${DEST}/current --backup-dir ${DEST}/$(date +%Y-%m-%d-%H%M%S)
You can then run that via termux:boot using the termux job scheduler
Contents of .termux/boot/rclone.sh
#!/bin/bash
# every 4 hours if on wifi and charging, run backup
termux-job-scheduler -s ~/bin/backup.sh --period-ms 14400000 --network unmetered --charging true