Matthias Andreas Benkard | 152901b | 2022-09-13 06:17:25 +0200 | [diff] [blame] | 1 | // SPDX-FileCopyrightText: © 2021 Matthias Andreas Benkard <code@mail.matthias.benkard.de> |
| 2 | // |
| 3 | // SPDX-License-Identifier: GFDL-1.3-or-later |
| 4 | |
| 5 | = Mulkup |
| 6 | Matthias 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 | |
| 21 | A configurable https://bupstash.io[bupstash] wrapper. |
| 22 | |
| 23 | |
| 24 | == Summary |
| 25 | |
| 26 | Mulkup is a backup script that wraps https://bupstash.io[bupstash]. |
| 27 | |
| 28 | Features: |
| 29 | |
| 30 | - Backup rotation (hourly, daily, weekly, monthly) |
| 31 | - Multiple stashes |
| 32 | - Exclusion lists |
| 33 | |
| 34 | |
| 35 | == Installation |
| 36 | |
| 37 | === Using Stack |
| 38 | |
| 39 | Outside of Nix, https://haskellstack.org/[Stack] is the easiest way to |
| 40 | install Mulkup. |
| 41 | |
| 42 | Check out the repository and run: |
| 43 | |
| 44 | [source,console] |
| 45 | ---- |
| 46 | stack install |
| 47 | ---- |
| 48 | |
| 49 | === Using Nix |
| 50 | |
| 51 | Mulkup is available as a |
| 52 | https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#description[Nix |
| 53 | flake]: |
| 54 | |
| 55 | [source,console] |
| 56 | ---- |
| 57 | nix profile install github:benkard/mulkup |
| 58 | ---- |
| 59 | |
| 60 | === Using Cabal |
| 61 | |
| 62 | It is possible to install Mulkup using |
| 63 | https://www.haskell.org/cabal[Cabal]. Note that this is less reliable |
| 64 | than either Stack or Nix and requires an installation of |
| 65 | http://ghc.haskell.org[GHC]. |
| 66 | |
| 67 | Check out the repository and run: |
| 68 | |
| 69 | [source,console] |
| 70 | ---- |
| 71 | cabal install |
| 72 | ---- |
| 73 | |
| 74 | |
| 75 | == Usage |
| 76 | |
| 77 | Copy link:config.example.dhall[`config.example.dhall`] to `config.dhall` and open it in a text editor. |
| 78 | |
| 79 | Execute the program without arguments to perform a backup: |
| 80 | |
| 81 | [source,console] |
| 82 | ---- |
| 83 | mulkup |
| 84 | ---- |
| 85 | |
| 86 | A simple configuration file that defines a single stash might look |
| 87 | like the following: |
| 88 | |
| 89 | [source,dhall] |
| 90 | ---- |
| 91 | let home = "/home/mulk" in |
| 92 | |
| 93 | { host = "mulkinator" |
| 94 | , stashes = |
| 95 | [ { name = "mulk.tar" |
| 96 | , baseDir = home |
| 97 | |
| 98 | , tiers = |
| 99 | { hourly = { keep = 24 } |
| 100 | , daily = { keep = 7 } |
| 101 | , weekly = { keep = 4 } |
| 102 | , monthly = { keep = 12 } |
| 103 | } |
| 104 | |
| 105 | , exclusions = |
Matthias Andreas Benkard | b0a5a5d | 2022-09-13 14:04:18 +0200 | [diff] [blame^] | 106 | [ "**/.stack-work" |
Matthias Andreas Benkard | 152901b | 2022-09-13 06:17:25 +0200 | [diff] [blame] | 107 | , "**/dist-newstyle" |
| 108 | , "${home}/.cabal/bin" |
| 109 | , "${home}/.cabal/packages" |
| 110 | , "${home}/.ghcup" |
| 111 | , "${home}/.stack" |
| 112 | , "${home}/Library/Caches" |
| 113 | ] |
| 114 | } |
| 115 | ] |
| 116 | } |
| 117 | ---- |
| 118 | |
| 119 | You can add as many stashes to the `stashes` list as you like. |