I started with a generic rsync command and customized it, but every step failed and I had to find the answer why. Then, after a successful connection and transfer, it threw errors on every file, which I found was due to a bug in some versions of rsync, so I had to find a workaround to that.
At any rate, here is a basic, working rsync command for transferring photos from the phone to a computer.
It can be used to back up any directory by changing "/sdcard/DCIM/Camera" to the directory you want to backup. It can also transfer files from the computer to the phone by changing the order of the two paths from /sdcard/DCIM/Camera COMPUSER@IP:/PATH/TO/SYNC/TO to COMPUSER@IP:/PATH/ON/COMP /PATH/ON/PHONE
#! /system/bin/shCopy "syncpics" to your clipboard with this QR code, but don't forget to edit it to fill out your login information.
rsync -rltDv -e "ssh -l USER -i /PATH/TO/SSHKEY" /sdcard/DCIM/Camera USER@IP:/DIR/TO/SYNC/TO