Automatic execution using Crontab

Create a bash script and save it in an appropriate location. Then type crontab -e, and paste this:

0 2 * * * /bin/bash /home/pi/rsync-script.sh

This will run your script daily at 2 am.

You can use crontab.guru to generate CRON schedules.

You're Welcome