Setup a cron job on the router to run the backup script every night at 2 AM:

router$ EDITOR=$(which nano) crontab -e

Insert the line as follows:

1
2
3
4
5
6
7

# Send any output by mail to `hostmaster@example.net'MAILTO=hostmaster@example.net
##min hour mday month wday cmd0002 * * * /root/openwrt-backup.sh
# crontab and fstab must end with the last line a space or comment