Gogs backup in kubernetes

Gogs version 0.11.86.0130

I installed Gogs in kubernetes using helm chart in https://charts.helm.sh/incubator. Installation is successful. I want to backup Gogs using “gogs --backup” command. It’s reporting error:

[FATAL] Fail to dump repositories: open /root/gogs-repositories: no such file or directory

Steps followed:-

  1. kubectl exec -it – bash
  2. export USER=git
  3. ./gogs backup

Complete log:-
bash-4.4# export USER=git
bash-4.4# ./gogs backup
2021/03/19 05:20:17 [ INFO] Backup root directory: /tmp/gogs-backup-011136395
2021/03/19 05:20:17 [ INFO] Packing backup files to: gogs-backup-20210319052017.zip
2021/03/19 05:20:17 [ INFO] Dumping repositories in ‘/root/gogs-repositories’
2021/03/19 05:20:17 [FATAL] Fail to dump repositories: open /root/gogs-repositories: no such file or directory
bash-4.4# ./gogs --version
Gogs version 0.11.86.0130

Backup successful:-
bash-4.4# export USER=git
bash-4.4# export HOME=/data/git
bash-4.4# ./gogs backup -c /data/gogs/conf/app.ini
2021/03/19 13:26:13 [ INFO] Backup root directory: /tmp/gogs-backup-944642247
2021/03/19 13:26:13 [ INFO] Packing backup files to: gogs-backup-20210319132613.zip
2021/03/19 13:26:13 [ INFO] Dumping repositories in ‘/data/git/gogs-repositories’
2021/03/19 13:26:13 [ INFO] Repositories dumped to: /tmp/gogs-backup-944642247/repositories.zip
2021/03/19 13:26:13 [ INFO] Backup succeed! Archive is located at: gogs-backup-20210319132613.zip