Automated gogs backups via script

Is there a way to automate gogs backup via a script and keep a weeks worth of daily backups?

thank you!

You could write a script to execute ./gogs backup command. Be noted that it is best to stop Gogs while doing the backup command.

Ref: How to backup, restore and migrate