blob: 34586a803df0d3697cbe872af0b446e6b8c1232e [file] [log] [blame]
Matthias Andreas Benkard152901b2022-09-13 06:17:25 +02001// SPDX-FileCopyrightText: © 2021 Matthias Andreas Benkard <code@mail.matthias.benkard.de>
2//
3// SPDX-License-Identifier: GFDL-1.3-or-later
4
5= Mulkup
6Matthias Andreas Benkard
7// Meta
8:experimental:
9:data-uri:
10:sectnums:
11:toc:
12:stem:
13:toclevels: 2
14:description: Mulkup Manual
15:keywords: mulk
16// Settings
17:icons: font
18:source-highlighter: rouge
19
20
21A configurable https://bupstash.io[bupstash] wrapper.
22
23
24== Summary
25
26Mulkup is a backup script that wraps https://bupstash.io[bupstash].
27
28Features:
29
30 - Backup rotation (hourly, daily, weekly, monthly)
31 - Multiple stashes
32 - Exclusion lists
33
34
35== Installation
36
37=== Using Stack
38
39Outside of Nix, https://haskellstack.org/[Stack] is the easiest way to
40install Mulkup.
41
42Check out the repository and run:
43
44[source,console]
45----
46stack install
47----
48
49=== Using Nix
50
51Mulkup is available as a
52https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#description[Nix
53flake]:
54
55[source,console]
56----
57nix profile install github:benkard/mulkup
58----
59
60=== Using Cabal
61
62It is possible to install Mulkup using
63https://www.haskell.org/cabal[Cabal]. Note that this is less reliable
64than either Stack or Nix and requires an installation of
65http://ghc.haskell.org[GHC].
66
67Check out the repository and run:
68
69[source,console]
70----
71cabal install
72----
73
74
75== Usage
76
Matthias Andreas Benkardae92ecd2022-10-05 07:46:46 +020077Copy link:config.example.dhall[`config.example.dhall`] to
78`config.dhall` and open it in a text editor. Edit it to suit your
79needs.
80
81To configure the bupstash repository, key, and any other settings
82available in bupstash itself, set the corresponding
83https://bupstash.io/doc/man/bupstash-put.html#ENVIRONMENT[environment
84variables]. See the
85https://bupstash.io/doc/man/bupstash.html[bupstash manual] for
86details.
Matthias Andreas Benkard152901b2022-09-13 06:17:25 +020087
88Execute the program without arguments to perform a backup:
89
90[source,console]
91----
92mulkup
93----
94
95A simple configuration file that defines a single stash might look
96like the following:
97
98[source,dhall]
99----
100let home = "/home/mulk" in
101
102{ host = "mulkinator"
103, stashes =
104 [ { name = "mulk.tar"
105 , baseDir = home
106
107 , tiers =
108 { hourly = { keep = 24 }
109 , daily = { keep = 7 }
110 , weekly = { keep = 4 }
111 , monthly = { keep = 12 }
112 }
113
114 , exclusions =
Matthias Andreas Benkardb0a5a5d2022-09-13 14:04:18 +0200115 [ "**/.stack-work"
Matthias Andreas Benkard152901b2022-09-13 06:17:25 +0200116 , "**/dist-newstyle"
117 , "${home}/.cabal/bin"
118 , "${home}/.cabal/packages"
119 , "${home}/.ghcup"
120 , "${home}/.stack"
121 , "${home}/Library/Caches"
122 ]
123 }
124 ]
125}
126----
127
128You can add as many stashes to the `stashes` list as you like.