Skip to content

Commit 7c556a4

Browse files
Merge pull request #462 from github/djj/update-docs-for-pruning
Add details about snapshot pruning
2 parents d9b90b4 + 950846f commit 7c556a4

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

docs/scheduling-backups.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Regular backups should be scheduled using `cron(8)` or similar command
44
scheduling service on the backup host. The backup frequency will dictate the
55
worst case [recovery point objective (RPO)][1] in your backup plan. We recommend
66
hourly backups at the least.
7-
87
## Example scheduling usage
98

109
The following examples assume the Backup Utilities are installed under
@@ -17,30 +16,36 @@ based on the frequency of backups. The ten most recent snapshots are retained by
1716
default. The number should be adjusted based on backup frequency and available
1817
storage.
1918

20-
By default all expired and incomplete snapshots are deleted at the end of the main
21-
backup process `ghe-backup`. If pruning these snapshots takes a long time you can
22-
choose to disable the pruning process from the backup run and schedule it separately.
23-
This can be achieved by enabling the `GHE_PRUNING_SCHEDULED` option in `backup.config`.
24-
Please note if this option is enabled, you will need to schedule the pruning script `ghe-prune-snapshots`
25-
using `cron` or similar command scheduling service on the backup host.
26-
2719
To schedule hourly backup snapshots with verbose informational output written to
2820
a log file and errors generating an email:
21+
```
22+
2923
30-
31-
32-
0 * * * * /opt/backup-utils/bin/ghe-backup -v 1>>/opt/backup-utils/backup.log 2>&1
24+
0 * * * * /opt/backup-utils/bin/ghe-backup -v 1>>/opt/backup-utils/backup.log 2>&1
25+
```
3326

3427
To schedule nightly backup snapshots instead, use:
3528

36-
29+
```
30+
3731
38-
0 0 * * * /opt/backup-utils/bin/ghe-backup -v 1>>/opt/backup-utils/backup.log 2>&1
32+
0 0 * * * /opt/backup-utils/bin/ghe-backup -v 1>>/opt/backup-utils/backup.log 2>&1
33+
```
34+
35+
### Example snapshot pruning
36+
37+
By default all expired and incomplete snapshots are deleted at the end of the main
38+
backup process `ghe-backup`. If pruning these snapshots takes a long time you can
39+
choose to disable the pruning process from the backup run and schedule it separately.
40+
This can be achieved by enabling the `GHE_PRUNING_SCHEDULED` option in `backup.config`.
41+
Please note that this option is only avilable for `backup-utils` >= v3.10.0, if this option is enabled you will need to schedule the pruning script `ghe-prune-snapshots` using `cron` or a similar command scheduling service on the backup host.
3942

4043
To schedule daily snapshot pruning, use:
4144

42-
45+
```
46+
4347
44-
0 3 * * * /opt/backup-utils/share/github-backup-utils/ghe-prune-snapshots 1>>/opt/backup-utils/prune-snapshots.log 2>&1
48+
0 3 * * * /opt/backup-utils/share/github-backup-utils/ghe-prune-snapshots 1>>/opt/backup-utils/prune-snapshots.log 2>&1
49+
```
4550

4651
[1]: https://en.wikipedia.org/wiki/Recovery_point_objective

0 commit comments

Comments
 (0)