Add commands to backup Gitea and copy locally

This commit is contained in:
James Skemp 2022-10-23 15:21:36 -05:00
parent 35df3841b3
commit b50bf507eb
1 changed files with 20 additions and 0 deletions

View File

@ -204,3 +204,23 @@ See https://docs.gitea.io/en-us/install-from-binary/#updating-to-a-new-version f
12. `sudo systemctl status gitea`
- Should be active (running).
13. After some period of time, delete the backup file.
### Regular backups
On the server:
```bash
sudo systemctl stop gitea
sudo su - git
gitea dump -c /etc/gitea/app.ini -w /var/lib/gitea -t /tmp
ls -l --block-size=M
rm <old-backup-file>
# Grant everyone read access to the backup file.
chmod a=r <backup-file>
exit
sudo systemctl restart gitea
```
On your local machine:
```bash
# Copy the file locally.
scp <user>@<remote_ip>:/home/git/<backup-file> d:\
```