Skip to content

Commit 3d9e356

Browse files
committed
docs: Add documentation for daemon
- update README.md - go mod tidy
1 parent 91bc13f commit 3d9e356

5 files changed

Lines changed: 40 additions & 9 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ REpository ArchivER(REAPER) is a tool to archive repositories from any Git serve
88
- [Usage](#usage)
99
- [rip](#rip)
1010
- [run](#run)
11+
- [daemon](#daemon)
1112
- [Configuration](#configuration)
1213
- [Storage](#storage)
1314
- [Run as docker container](#run-as-docker-container)
@@ -65,6 +66,16 @@ reaper run
6566

6667
Combined with cron, you can archive repositories periodically.
6768

69+
### daemon
70+
71+
`daemon` runs REAPER as a daemon. It will archive all repositories defined in configuration periodically.
72+
73+
```bash
74+
reaper daemon
75+
# You might want to run it with something like nohup
76+
nohup reaper daemon &
77+
```
78+
6879
## Configuration
6980

7081
For configuration, you can checkout this [example](config/example.config.yaml).
@@ -100,6 +111,10 @@ For example compose file, see [docker-compose.yml](docker-compose.yml).
100111
docker compose up -d
101112
```
102113

114+
## FAQ
115+
116+
See [FAQ](https://github.com/LeslieLeung/reaper/wiki/FAQ).
117+
103118
## Stargazers over time
104119

105120
[![Stargazers over time](https://starchart.cc/LeslieLeung/reaper.svg)](https://starchart.cc/LeslieLeung/reaper)

README_zh.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ REpository ArchivER(REAPER)是一个用于从任何Git服务器归档 Git
88
- [使用方法](#使用方法)
99
- [rip](#rip)
1010
- [run](#run)
11+
- [daemon](#daemon)
1112
- [配置](#配置)
1213
- [存储](#存储)
1314
- [使用 Docker 运行](#使用-docker-运行)
@@ -65,6 +66,16 @@ reaper run
6566

6667
结合cron,你可以定期归档 Git 仓库。
6768

69+
### daemon
70+
71+
`daemon`命令会启动一个守护进程,它会在后台运行,归档在配置中定义的所有 Git 仓库。
72+
73+
```bash
74+
reaper daemon
75+
# 使用 nohup 后台运行
76+
nohup reaper daemon &
77+
```
78+
6879
## 配置
6980

7081
有关配置,你可以查看此[示例](config/example.config.yaml)
@@ -97,9 +108,13 @@ docker run --rm \
97108
示例Compose配置,见 [docker-compose.yml](docker-compose.yml)
98109

99110
```bash
111+
git clone https://github.com/leslieleung/reaper.git
100112
docker compose up -d
101113
```
102114

115+
## 常见问题
116+
117+
[FAQ](https://github.com/LeslieLeung/reaper/wiki/FAQ)
103118

104119
## Stargazers over time
105120

docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ services:
99
- TZ=Asia/Shanghai
1010
volumes:
1111
# config file path, modify it to yours
12-
- ${pwd}/config/example.config.syaml:/config.yaml
12+
- ${pwd}/config/example.config.yaml:/config.yaml
1313
# data path, to store downloaded repo, modify it to yours
1414
# the in-container path need to be the same as defined in config file
1515
- ${pwd}/repo:/repo
16-
# defaultly archives all repositories defined in configuration.
16+
# by default archives all repositories defined in configuration.
1717
command: ["run"]
1818
# or just archives a single repository defined in configuration.
19-
# command: ["rip", "reaper"]
19+
# command: ["rip", "reaper"]
20+
# run as daemon
21+
# command: ["daemon"]

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ module github.com/leslieleung/reaper
33
go 1.21
44

55
require (
6+
github.com/go-co-op/gocron v1.35.3
67
github.com/go-git/go-git/v5 v5.10.0
78
github.com/google/uuid v1.4.0
89
github.com/gookit/color v1.5.4
910
github.com/mholt/archiver/v4 v4.0.0-alpha.8
11+
github.com/minio/minio-go/v7 v7.0.63
1012
github.com/spf13/cobra v1.7.0
1113
github.com/spf13/viper v1.17.0
1214
)
@@ -27,7 +29,6 @@ require (
2729
github.com/dustin/go-humanize v1.0.1 // indirect
2830
github.com/emirpasic/gods v1.18.1 // indirect
2931
github.com/fsnotify/fsnotify v1.6.0 // indirect
30-
github.com/go-co-op/gocron v1.35.3 // indirect
3132
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
3233
github.com/go-git/go-billy/v5 v5.5.0 // indirect
3334
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
@@ -44,7 +45,6 @@ require (
4445
github.com/klauspost/pgzip v1.2.5 // indirect
4546
github.com/magiconair/properties v1.8.7 // indirect
4647
github.com/minio/md5-simd v1.1.2 // indirect
47-
github.com/minio/minio-go/v7 v7.0.63 // indirect
4848
github.com/minio/sha256-simd v1.0.1 // indirect
4949
github.com/mitchellh/mapstructure v1.5.0 // indirect
5050
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
@@ -66,7 +66,7 @@ require (
6666
github.com/spf13/pflag v1.0.5 // indirect
6767
github.com/subosito/gotenv v1.6.0 // indirect
6868
github.com/therootcompany/xz v1.0.1 // indirect
69-
github.com/ulikunitz/xz v0.5.10 // indirect
69+
github.com/ulikunitz/xz v0.5.11 // indirect
7070
github.com/xanzy/ssh-agent v0.3.3 // indirect
7171
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
7272
go.uber.org/atomic v1.9.0 // indirect

go.sum

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
204204
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
205205
github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM=
206206
github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
207-
github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE=
208207
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
209208
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
210209
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
@@ -310,8 +309,8 @@ github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSW
310309
github.com/therootcompany/xz v1.0.1 h1:CmOtsn1CbtmyYiusbfmhmkpAAETj0wBIH6kCYaX+xzw=
311310
github.com/therootcompany/xz v1.0.1/go.mod h1:3K3UH1yCKgBneZYhuQUvJ9HPD19UEXEI0BWbMn8qNMY=
312311
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
313-
github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
314-
github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
312+
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
313+
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
315314
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
316315
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
317316
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=

0 commit comments

Comments
 (0)