Run scheduled backups using the Gitea dump function #152

Closed
ericbram wants to merge 7 commits from ericbram/helm-chart:master into main
First-time contributor

Backups are unfortunately not built in to the list of cron tasks made available by Gitea. While it's possible that in the future, backups will be added to the list of cron tasks, there's no current implementation. However, Gitea does provide a CLI command dump to execute this action.

This PR is used simply to construct a dump command based on the list of available options from the CLI, and following the recommendations from Gitea Backup and Restore.

It generates a ConfigMap script that gets placed in the appropriate /etc/periodic directory based on the backup schedule variable, which the pod executes accordingly. This can be used in conjunction with the extraVolumes/extraVolumeMounts to backup to persistent storage.

Backups are unfortunately not built in to the list of cron tasks made available by `Gitea`. While it's possible that in the future, backups will be added to the list of [cron tasks](https://docs.gitea.io/en-us/config-cheat-sheet/#cron-cron), there's no current implementation. However, `Gitea` does provide a CLI command `dump` to execute this action. This PR is used simply to construct a `dump` command based on the list of available options from the CLI, and following the recommendations from [Gitea Backup and Restore](https://docs.gitea.io/en-us/backup-and-restore/). It generates a ConfigMap script that gets placed in the appropriate `/etc/periodic` directory based on the backup `schedule` variable, which the pod executes accordingly. This can be used in conjunction with the `extraVolumes`/`extraVolumeMounts` to backup to persistent storage.
ericbram added 7 commits 2021-05-04 14:11:59 +00:00
Author
First-time contributor

Hmm actually it looks like crond isn't running by default on my test container -- I've just been manually running what cron would call. I'll see if there's a sufficient way to remedy.

Hmm actually it looks like `crond` isn't running by default on my test container -- I've just been manually running what `cron` would call. I'll see if there's a sufficient way to remedy.
ericbram closed this pull request 2021-05-06 19:38:26 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.