Commit graph

58 commits

Author SHA1 Message Date
Sondre Batalden
8be503893e past backup script 2024-05-24 13:27:34 +02:00
L3D
c70e0d660a
Merge pull request #120 from johanvdw/quote_multiple_sources
Make sure backup source list is escaped
2024-03-11 10:22:29 +01:00
Johan Van de Wauw
e3f0c932df
Make sure list is escaped 2024-03-11 09:27:45 +01:00
L3D
4b5477dd70
Merge branch 'main' into pre_backup_cmd
Signed-off-by: L3D <l3d@c3woc.de>
2024-01-26 15:45:44 +01:00
Felix Andersen
09af54284a template change and README clarification 2024-01-04 17:52:05 +00:00
Felix Andersen
dd5ad45ad4 added pre_backup_cmd to backup items 2024-01-03 18:33:10 +00:00
Felix Andersen
4d21e0f4c1 call restic backup script with nice 2024-01-03 18:32:15 +00:00
Johan Van de Wauw
304dc65ae9 Make sure stdin keeps working 2023-10-12 08:54:36 +02:00
Johan Van de Wauw
97240d044f Allow multiple paths as backup source 2023-10-11 18:10:51 +02:00
Johan Van de Wauw
6471843b05 Fix stderr redirection 2023-09-06 09:21:30 +02:00
Usman Iqbal
9cf2f6ad50 bugfix: Need to wrap Azure SAS tokens in quotes 2023-09-04 19:10:38 +01:00
Usman Iqbal
a291a09cce Add Azure Blob Storage support, based on restic documentation 2023-08-23 20:55:32 +01:00
Johan Van de Wauw
e5ae44bd66 Log stderr also to logfiles 2023-08-16 14:05:34 +02:00
L3D
7ec0667ac6
Merge pull request #78 from Hurricos/lvm
[WIP] feat: lvm: Add lvm-based backup functionality
2023-08-10 11:42:06 +02:00
jochen
f283f55288 Add option to limit maximum number of CPUs used. 2023-06-30 23:42:27 +02:00
Johan Van de Wauw
918693eb76
Fix minor typo 2023-03-08 08:52:54 +01:00
Martin Kennedy
6459eaa161 fix: lvm: Handle cleanup after unreadable files
Before this commit, since restic backup exits with status 3 if it
cannot read one or more files, the LVM snapshot wasn't being cleaned
up.

Now, specially handle the 3 exit status; also, unequivocally perform
the LVM cleanup when finished.
2023-03-07 16:26:36 -05:00
Martin Kennedy
de3d35d4ec fix: lvm: Allow / to be backed up as LVM
This commit causes an LVM backup target of / to be treated as /rootfs
instead.

Note that this will conflict with a path called /rootfs if we *do* try
to back that up.

Also, while we're at it, drop the -m option from mount. Not all
systems have this option.
2023-03-07 16:24:30 -05:00
Varac
fd854570cf
Fix exclude-caches directive
It's called --exclude-caches, not --exclude-cache
see https://restic.readthedocs.io/en/latest/040_backup.html#excluding-files
2022-09-12 09:16:24 +02:00
Martin Kennedy
4cf66ebec4 fix: More tweaks to get snapshot-finding to work
Grr! this is really frustrating. We need more "tracking" for the
snapshot we created.
2022-08-28 16:19:59 -04:00
Martin Kennedy
ae270aeebd [v2] feat: lvm: Add lvm-based backup functionality
This commit implements the needs of #75[^1]: it allows for the
creation of atomic backups when the backup target is a file/dir whose
fs rests on LVM. This ensures the snapshot will be atomic.

By using a mount namespace, the LVM snapshot can be done in the same
directory -- so existing LVM-based applications of ansible_role_restic
can be migrated to this implementation without any discontinuity in
what appears to be backed up.

This combination of LVM's snapshotting layer and mount namespaces
comes with some caveats:

- you cannot backup / due to namespace issues
- subdirs with a separate fs won't be correctly detected
- not all filesystems are happy about LVM snapshots -- btrfs, e.g.
- LVM snapshots come with a performance penalty when active
- fstrim and LVM snapshots don't like each other whatsoever

[^1]: https://github.com/roles-ansible/ansible_role_restic/issues/75

--
Changes in v2:
- Use `findmnt -v` to find snapshot when cleaning up
- Check for _snap before `lvremove -y`

Signed-off-by: Martin Kennedy <hurricos@gmail.com>
2022-08-28 16:12:46 -04:00
Sebastian Gumprich
9f710b8a0f add a monitoring call possibility 2022-07-12 21:25:34 +02:00
L3D
acef0d2dbc
change ansible to use FQCN and lowercase restic_systemd_timer_default_OnCalendar 2022-04-01 11:07:52 +02:00
L3D
d30e30fcae
optional cache directory 2022-01-18 17:20:02 +01:00
L3D
619f4263e9
print if someone is already running 2022-01-10 11:17:20 +01:00
L3D
3bd09b48f8
create a pidfile bevore running script, delete after 2022-01-10 11:01:01 +01:00
L3D
ee06222b20
disable timeout mechanism 2021-12-07 17:47:51 +01:00
Michał Lisowski
47f548d77e Fix #45: send email also on the main command failure 2021-11-30 12:26:37 +01:00
Michał Lisowski
132126abe3 Fix #10: support for systemd OnCalendar 2021-11-29 19:00:02 +01:00
Sebastian Gumprich
80dd304943 put errorlogs in journald, too 2021-10-20 10:38:01 +02:00
Sebastian Gumprich
a0c52127d5 add option to log to journald 2021-10-19 16:38:17 +02:00
L3D
1870c78534
restart restic timer if something changed 2021-07-07 11:20:37 +02:00
L3D
94aae0e3b9
improve error message 2021-07-05 16:18:46 +02:00
L3D
a7df28bce9
improve template error 2021-07-05 15:26:33 +02:00
L3D
9b8d0fe599
adding mail on error feature 2021-07-05 14:51:27 +02:00
L3D
f385bfcb73
Start improving systemd 2021-06-15 19:48:23 +02:00
L3D
6067180d63
reduce TimeoutStartSec to 900s 2021-05-04 15:37:20 +02:00
L3D
93b9de9826
implement systemd timer 2021-04-29 14:58:12 +02:00
Luca Zorzi
7cd26ca0f4
add: support for basic logging of backup result (#21)
* Added support for basic logging of backup result

* Added changelog entry

* Added full output logging

* Changed logging date format to include the time as well as the date

* Fixed error on backup script creation if enable_logging was not specified for a backup job

* Improved backup script by removing duplicate code

* Added variable restic_log_dir to the readme
2020-12-13 16:53:24 +01:00
Luca Zorzi
308b068f20
Added support for Backblaze B2 (#18)
authored-by: Luca Zorzi <luca@lucazorzi.net>
2020-09-08 10:17:46 +02:00
Matthias Leutenegger
1ff31d56d7 CHANGE: add exclude tags also to stdin command 2020-06-05 09:05:15 +02:00
Matthias Leutenegger
ea143592b9 ADD: exclude option 2020-06-05 09:01:36 +02:00
Matthias Leutenegger
9bc6c06deb CHANGE: use single quotes 2020-06-04 19:22:47 +02:00
Matthias Leutenegger
a563473b58 CHANGE: update all vars 2020-06-03 22:45:20 +02:00
Matthias Leutenegger
60b29a64a7 CHANGE: use solution proposed by @alt4 2020-06-03 08:52:02 +02:00
Matthias Leutenegger
d4ee01a305 CHANGE: use regex_escape() 2020-06-01 19:39:47 +02:00
Matthias Leutenegger
83d6f50cc4
Update restic_access_Linux.j2 2020-06-01 19:38:08 +02:00
alt
75ad299fb7 Export S3 vars 2020-05-24 15:13:26 +02:00
alt
90a4cf5d85 Add support for AWS_DEFAULT_REGION 2020-05-24 13:56:52 +02:00
Maciej Mionskowski
692038994d
Execute backup scripts in bash shell 2020-05-01 10:58:00 +02:00