gitea: [doc] ./gitea dump doesn't allows to specify backup destination
I like gitea dump because it allows to backup everything into a single file, but I find it difficult to automate (weekly cron job) because it’s doesn’t allows to specify the exact destination of the backup (to copy it elsewhere for example).
That leaves us with the (not pretty) option to parse the output to get the zip name… something like gitea dump --destination /path/to/zip would be great.
Sorry not a go developer, if not I will simply send a PR for this (yeps it’s a lame excuse, I know =)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 19 (10 by maintainers)
I recently tried tackling this using cron on my debian machine, but I had no luck. However, I found great sucess using a systemd service/timer and setting the
WorkingDirectoryto wherever you like.The service file:
Timer:
And the output of
/var/gitea/backup:This is not yet documented
./gitea dump 2>&1 >/dev/null | awk 'END {print $NF}'(just in case somebody wonders how to get it)So it looks like this has been implemented with: –file name, -f name: Name of the dump file with will be created. Optional. (default: gitea-dump-[timestamp].zip).
I guess you can close this issue? And to anyone else using the AWK trick from above: that doesn’t work anymore.
--targetis not documented in https://docs.gitea.io/en-us/backup-and-restore/Should be easy enough to change
--targetto take a filename instead of a directory 😃--work-diris also not documented (https://github.com/go-gitea/gitea/issues/9100)@lunny I was just mentioning the missing documentation, in addition to the feature request discussed here - I think it’s a good opportunity to fix the documentation. I don’t think
--targetaccepts a destination filename (only a directory).I would appreciate this change, because I run dumps from a cron job and the destination directory ends up cluttered with daily dumps.
But maybe some people prefer the old behavior - in this case there could be 2 separate options (
--destdir--destfile), or we could just resort to--destfile /var/backups/gitea/gitea-dump-$(date +%s)