Commit graph

37 commits

Author SHA1 Message Date
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
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
Michał Lisowski
47f548d77e Fix #45: send email also on the main command failure 2021-11-30 12:26:37 +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
94aae0e3b9
improve error message 2021-07-05 16:18:46 +02:00
L3D
9b8d0fe599
adding mail on error feature 2021-07-05 14:51:27 +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
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
Matthias Leutenegger
8b0c016e7d ADD: S3 compatibility 2019-12-17 14:19:25 +01:00
Matthias Leutenegger
6fd05902e2 add prune option 2019-09-11 16:06:18 +02:00
Matthias Leutenegger
6b4dcdb5ae Check if item.src is actually filled 2019-09-11 15:58:57 +02:00
Matthias Leutenegger
0053f18814 add credential file 2019-09-11 11:31:51 +02:00
Matthias Leutenegger
d97bbf8fce some fixing of the tag keeping 2019-09-11 11:29:36 +02:00
Matthias Leutenegger
d6bb19bf1a Adds cron tag depending on execution 2019-08-14 16:16:16 +02:00
Matthias Leutenegger
d727654d27 Script is system specific 2019-08-14 16:03:03 +02:00
Renamed from templates/restic_script.j2 (Browse further)