Thanks for this! nostr-scripts really helped me. It also had me discover the great nostr army knife by nostr:npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6 : https://github.com/fiatjaf/nak
Have a look at - https://github.com/jooray/nostr-scripts
You configure the backup script with your server address and it sync your notes there.
Discussion
`nak req` has recently added the `--paginate` and related flags that should, if I understand them correctly, remove the need for these scripts. The README has some examples.