Skip to content

docker: support adding extra options to backup command #7060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 17, 2022

Conversation

liuxhit
Copy link

@liuxhit liuxhit commented Jun 15, 2022

Describe the pull request

PR-#6003 added support for exclude mirror repositories when backup, but we do not have a convinent way for docker use.

This PR:

  1. add aupport for set custom backup args via docker environment;
  environment:
      - TZ=Asia/Shanghai
      - RUN_CROND=true
      - BACKUP_INTERVAL=3d
      - BACKUP_RETENTION=7d
      - BACKUP_EXTRA_ARGS=--verbose --exclude-mirror-repos

2.fix bug that failing to backup when there is multipul parameters, otherwise we will see errors in the log:

2022/06/15 10:31:00 [ INFO] Packing backup files to: /backup --verbose --exclude-mirror-repos/gogs-backup-20220615103100.zip
2022/06/15 10:31:00 [FATAL] [...s.io/gogs/internal/cmd/backup.go:90 runBackup()] Failed to create backup archive '/backup --verbose --exclude-mirror-repos/gogs-backup-20220615103100.zip': open /backup --verbose --exclude-mirror-repos/gogs-backup-20220615103100.zip: no such file or directory
Error: Backup job returned non-successful code.

Link to the issue: n/a

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code.

Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@unknwon unknwon changed the title Feature/add extra opts to backup envs docker: support adding extra options to backup command Jun 25, 2022
@unknwon unknwon merged commit 05a6a9d into gogs:main Jul 17, 2022
@unknwon
Copy link
Member

unknwon commented Jul 17, 2022

Thank you!

dna2github pushed a commit to dna2fork/gogs that referenced this pull request May 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants