What is the best way to run automated backups on Windows?
At the moment I have a batch file, this will be started by a scheduled task. The zip file is getting created. But now I’m unable to copy this zip file, because I don’t know the name of the file. Is there a way to set a name or a path for the zip file?
I am working on a local backup script that I think will include the dump,then moving all files starting with “gitea-dump-” to a “backup”-folder (gitea dump; mv gitea-dump-* backup/; cp backup/ ...) or something like that, and then I will be able to directly copy the backup folder. Then again, I am working with docker containers, so that is why I can’t copy using a wildcard.
When you are running Gitea, if you start it from a terminal, have you tried running gitea dump in parallel? I just tried it locally and as far as I can see it created a proper backup, but I am not aware of your setup.
[quote]
When you are running Gitea, if you start it from a terminal, have you tried running gitea dump in parallel? [/quote]
Yes, I tried that, but something is in use and I got this error message:
Failed to save gitea-dump-1554985320.zip: read C:/Users/UserName/gitea/data/indexers/issues.bleve/store.lock: The process cannot access the file because another process has locked a portion of the file.
I think that is not the problem. Because when I shutdown the gitea webservice the backup runs. I think gitea has a file in use and look this file. I the evening I will try this on another machine, to find out the behavior.
cd c:\windows\system32
sc stop gitea
cd c:\Users\UserName\gitea\
gitea dump
cd c:\windows\system32
sc start gitea
cd c:\Users\UserName\gitea\
move c:\Users\UserName\gitea\*.zip x:\Backups\gitea
I run this file by a scheduled task. The task has to run with highest privileges!