68 Commits

Author SHA1 Message Date
Gerard Bosch
de28285741 fix: Change INSTALL_PREFIX placeholder notation to templating notation (#131)
* refactor: Change INSTALL_PREFIX placeholder notation to templating notation

The former shell notation `$INSTALL_PREFIX` could result confusing. As
this is a placeholder that's replaced in the `make`, we switch it to a
template notation `{{ INSTALL_PREFIX }}`.

* docs: Small fix on README/manual setup

* docs(email-notif): Document the `{{ INSTALL_PREFIX }}` placeholder

co-authored-by: giuaig <13609224+giuaig@users.noreply.github.com>

* Update README.md

Co-authored-by: Gerard Bosch <30733556+gerardbosch@users.noreply.github.com>

---------

Co-authored-by: giuaig <13609224+giuaig@users.noreply.github.com>
Co-authored-by: Erik Westrup <erik.westrup@icloud.com>
2023-12-13 23:49:41 +05:30
Erik Westrup
37f4775eaa Add restic-check launchagent 2022-02-15 12:42:25 +01:00
Erik Westrup
7bc15e2254 Rename backup launchagent 2022-02-15 11:33:30 +01:00
Erik Westrup
9449d78596 Made scripts optional 2022-02-13 19:15:55 +01:00
Erik Westrup
bb40afa67a Rename launchagent for consistency 2022-02-13 17:50:10 +01:00
Erik Westrup
cfaab7eb72 Move schedtasks to own subdir 2022-02-13 11:46:02 +01:00
Erik Westrup
6cb6b41066 Modified: Makefile 2022-02-13 11:32:58 +01:00
Erik Westrup
16302e5d35 Add uninstall 2022-02-13 11:29:04 +01:00
Erik Westrup
aeec8991b6 rename schedtask ps1 2022-02-13 11:14:04 +01:00
Erik Westrup
9ff51d691a WIP make target for scheduledtask 2022-02-12 19:11:47 +01:00
Erik Westrup
edaafdf10a Fix phony target 2022-02-12 19:00:15 +01:00
Erik Westrup
399e7cd4ce Fix launchagent macro 2022-02-12 17:40:26 +01:00
Erik Westrup
0f3d39dfe1 Custom launchagent dir 2022-02-12 17:33:29 +01:00
Erik Westrup
8f118b6ddf Allow make to override etc dir 2022-02-11 22:07:26 +01:00
Erik Westrup
289016f8ea No need to write perm on scripts 2022-02-11 21:46:56 +01:00
Erik Westrup
2a287910cb Allow override INSTALL_PREFIX on make cli 2022-02-11 20:34:33 +01:00
Erik Westrup
caf95ef393 Add make target to activate launchagent 2022-02-09 17:16:18 +01:00
Erik Westrup
991476715a install instructions 2022-02-09 15:56:37 +01:00
Erik Westrup
c8ab0b4421 iterate 2022-02-09 14:04:07 +01:00
Erik Westrup
e9d77d0a31 Surpress mkdir 2022-02-09 13:08:12 +01:00
Erik Westrup
bd3123bef4 Modified: Makefile 2022-02-09 13:08:12 +01:00
Erik Westrup
ddd2233c58 Install LaunchAgent in user Library 2022-02-09 13:08:12 +01:00
Erik Westrup
7973eedae4 Modified: Makefile 2022-02-09 13:08:12 +01:00
Erik Westrup
193bf926cf PoC souce files 2022-02-09 13:08:12 +01:00
Erik Westrup
7a1409ca03 Allow users to execute scripts 2022-02-08 18:20:49 +01:00
Erik Westrup
e688499838 Surpress mkdir in make install 2022-02-08 16:49:10 +01:00
Erik Westrup
645df1a0d4 Move /sbin to /bin
As more users would have /bin than /sbin in their PATH
2022-02-07 18:22:36 +01:00
Erik Westrup
54e2d17e23 Modified: CHANGELOG.md Makefile 2022-02-06 15:28:56 +01:00
Erik Westrup
c01bb5a00e Fix broken help target 2022-02-06 15:10:31 +01:00
Erik Westrup
8db3d27174 Rename top-level install targets
"make install" -> "make install-systemd"
so that I could now add a
""make install-cron"
target.

Soon there will be
"make install-macos"
"make install-windows"

Thus it does not make sense to have a general `make install` anymore.
2022-02-06 14:49:00 +01:00
Erik Westrup
1ee0e2c919 Fix cron with multiple profiles 2022-02-06 14:36:41 +01:00
Erik Westrup
0255ad03d8 Format comments 2022-02-05 15:52:36 +01:00
Erik Westrup
5942762514 Correct build source depdendency 2022-02-05 15:48:58 +01:00
Erik Westrup
6b315814d0 spell 2022-02-05 15:45:45 +01:00
Erik Westrup
dd092af6a1 Remove legacy .template 2022-02-05 15:43:57 +01:00
Erik Westrup
7f86dbd9f4 Consistent macro names in Makefile 2022-02-05 15:40:00 +01:00
Erik Westrup
494bcc29f0 s/SCRIPTS/SCRIPT/g 2022-02-05 15:40:00 +01:00
Erik Westrup
c43367fab3 Simpler sed expression 2022-02-05 15:27:43 +01:00
Erik Westrup
67cd6ee94b Add back dependency on builddir 2022-02-05 15:18:39 +01:00
Erik Westrup
a117c95508 Format Makefile 2022-02-05 15:13:01 +01:00
Erik Westrup
fc04da5a2d Fix comment 2022-02-05 15:04:44 +01:00
Erik Westrup
25666f17a0 Remove old out-commented solution 2022-02-05 15:02:53 +01:00
Erik Westrup
ccf39e822d Remove comment not relevant 2022-02-05 15:02:24 +01:00
Erik Westrup
1a890de7ac Remove target dependency that was not cleaned up before 2022-02-05 14:55:24 +01:00
Erik Westrup
4236c93b57 spell 2022-02-05 14:53:32 +01:00
Erik Westrup
861535a86e Check properly for GNU install 2022-02-05 14:48:38 +01:00
Erik Westrup
9760cd05ec Truly support custom PREFIX= install
* Before, doing `$ PREFIX=/usr/local make install` would install files to`/usr/local/usr/local..` which is wrong
* With this PR, files will be installed to the expected location e.g. `/usr/local/etc/restic`
* `Makefile` almost completely rewritten
   * As e.g. `default.env` would source `_global.env`, `default.env` must be edited to find the right location of `_global.env` depending on what `$PREFIX` was set to.
   * see documented build stages in the `Makefile` itself.
   *  Made sure that the rules are correct so that only modifed files are installed, not all at once unnecessarily like before.
* A sub-goal was that the [PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=restic-systemd-automatic-backup#n20) for Arch should not need to do any custom install configuration, to keep everything easier to maintain. `$ make install` should work out of the box for Arch.
* Additionally added the `-b` flag to `install(1)` that makes a backup of existing `etc/restic/*` files before installing a newer version.

Fixes #49
2022-02-03 20:52:00 +01:00
Gerard Bosch
3852e305b6 Add resticw (restic wrapper) utility (#60)
The script provides a convenient way to load environment config, deal
with profiles and act as a pass-through to restic. The overall thing is
to improve the UX when running restic, integrating the features this
project provides.

## Note

The script itself is a very simple thing.
The command line parser is auto-generated using docopt.sh driven from
the script's DOC. It can be refreshed upon DOC changes with:
`docopt.sh path/to/resticw`.

## How to use it

### Examples

```console
sudo resticw stats latest

sudo resticw -p profileA snapshots
```

### Help

```console
❯ resticw --help
A little wrapper over restic just to handle profiles and environment loading.

  It loads the backup profile/environment in a subshell to avoid any credential leak (Note: Run it with sudo so it can load the environment).

  Usage:
    resticw [options] <restic_arguments>

    The restic_arguments is just the regular unwrapped restic arguments, e.g. stats latest

  Options:
    -p --profile=<name>        Specify the profile to load or use default [default: default].

  Examples:
    sudo resticw --profile profileA snapshots
    sudo resticw stats latest  # this will use the profile: default
```



Co-authored-by: Erik Westrup <erik.westrup@gmail.com>
2022-02-03 20:40:45 +01:00
Gerard Bosch
d8f25cdf88 Multiple profile configuration (#45)
Adds possibility to have multiple profiles with different backup paths, retention etc.

Co-authored-by: Matt Feifarek <matt.feifarek@gmail.com>
Co-authored-by: Erik Westrup <erik.westrup@gmail.com>
2022-02-01 10:09:36 +01:00
Erik Westrup
5eeab95c84 Create backup of existing config files on install 2022-01-17 15:53:17 +01:00