Commit Graph

560 Commits

Author SHA1 Message Date
Jerome Charaoui
45e4c5831c borg: raise fatal error for missing includes 2021-01-03 12:18:46 -05:00
Jerome Charaoui
beff3adc1e Remove remaining vserver bits 2021-01-03 12:07:56 -05:00
Jerome Charaoui
40a346ff13 rsync: change id_dsa to id_rsa in rsync handler, fixes #11315
Also changed in example config.
2021-01-02 15:56:54 -05:00
Jerome Charaoui
eabda5615c Remove vserver support (fixes #11289)
This is probably completely unused by now, as vservers have been
superseeded by alternative technology for many years already.
2021-01-02 15:27:32 -05:00
Jerome Charaoui
076ef20ead borg: fix typos in debug messages 2021-01-02 14:59:58 -05:00
Jerome Charaoui
fe30b5cce3 tar: add support from zstd compression filter 2021-01-02 13:49:41 -05:00
Jerome Charaoui
ff2376f56c tar: properly default to gzip in case of unknown compress filter 2021-01-02 13:49:22 -05:00
lavamind
ac8b41eb87 Merge branch 'fix_11316' into 'master'
Support LUKS v2 headers, fixes #11316

Closes #11316

See merge request riseuplabs/backupninja!47
2020-12-31 08:12:39 -08:00
Gabriel Filion
5c6c583181 Enable use of ionice for all handlers to alleviate IO load
On some workloads, a process creating backups should not become so
aggressive on resources that it prevents normal activity of a machine
from running. It is especially important when writing to disk.

One way to make backups have less impact on the main workload is to
force backups to a lower ionice level.

With the new ionicelevel configuration, it becomes possible for users to
activate the use of ionice and to define the level within the
best-effort class to better suit their needs.
2020-12-31 02:08:50 -05:00
Jerome Charaoui
79903cd689 Replace dd with cryptsetup luksHeaderBackup
Since the luks headers backup was introduced in the handler, cryptsetup
has gained the "luksHeaderBackup" command. We should use this instead
of dd, as it is likely more reliable. Plus, it supports backing up luks
version 2 headers, which the current code doesn't handle.
2020-12-30 15:25:30 -05:00
Jerome Charaoui
c655eceaa3 Reuse lsblk command to list devices for luksheaders
The previous sfdisk-based command would also list partitions, leading to
partition-based luks volumes being duplicated. Instead, reuse the same
command used in the partition backup component.
2020-12-30 15:20:02 -05:00
lavamind
0491432147 Merge branch '11293-partition_table_backup' into 'master'
Do not try to dump partition tables for a disk when non are detected

Closes #11293

See merge request riseuplabs/backupninja!22
2020-12-30 09:57:28 -08:00
Emil Breiner
582024f4bf Quoting test of $create_options in borg handler
The check for the string length in the condition for appending the $create_options fails because it isn't a string. Fixed with quoting the variable.

Change-Id: I6bdacb81f25cf924dc61e3aa6f4b8ebfbe09da65
Signed-Off-By: Emil Breiner <emil.breiner@krumedia.com>
2020-09-08 12:13:23 +02:00
Matthias Blümel
ab8d5a3a39 Merge branch 'fix_11272' into 'master'
Fix ninjahelper bug in the mysql helper

Closes #11272

See merge request riseuplabs/backupninja!23
2020-09-01 09:20:15 -07:00
Guillaume Subiron
10b8887b8e Merge branch 'borg_cache_dir_location' into 'master'
Borg cache dir location

See merge request riseuplabs/backupninja!29
2020-08-14 05:46:34 -07:00
LeLutin
e28da8c390 borg: add configuration to displace the cache directory
borg will by default create its cache directory in ~/.cache/borg. This
means that during backup runs, borg will read and write quite
extensively from/to this directory.

In some situations, it is rather undesirable to have this amount of IO
activity in this location and it would make sense to tell borg to place
its cache elsewhere. This can help for example with placing the cache on
a hard drive where the added IO load will not have as big of an impact
on other running activity for the system.

This change also makes sure that the cache directory environment
variable is cleared out when the configuration option is unset. This
should avoid unpleasant surprises when this environment variable is set
to some unknown value in the context where backupninja is called, which
could lead to borg reading and writing to random places on the system.
2020-08-14 05:46:34 -07:00
Guillaume Subiron
edcdf9dc52 Merge branch 'borg-port' into 'master'
handlers/borg: add port support

Closes #11296

See merge request riseuplabs/backupninja!31
2020-08-14 05:32:03 -07:00
tiredpixel
3d7494bfc2 handlers/borg: add port support
This enables the handlers to be used for hosts which use a non-standard
port, such as is offered by some commercial services. Default to port
22, so it's optional and backwards-compatible.
2020-07-16 08:38:46 +00:00
Julien Rabier
ac40f35542 Update sys.in to add missing "disk" flag.
It seems like only the short output of hwinfo --disk is provided to hardware.txt. I'd suggest we also add disk to the flags for the "complete" output.
That's especially useful when you need to indicate the serial number of a dead drive in order for it to be replaced. Once the disk is dead, using hardware.txt can be the only way to retrieve this info.
2019-02-04 09:12:12 -08:00
Aurélien Olivier
82c25f4fee Remove double quotes when parsing $result 2018-11-17 11:03:30 +01:00
Aurélien Olivier
e3c1a7a5e9 checkBox function: use on/off instead of yes/no
This function uses on/off to define default values.
2018-11-17 10:51:02 +01:00
Kienan Stewart
f449c7c656
Do not try to dump partition tables for a disk when non are detected
Refs #11293
2018-10-05 14:25:48 -04:00
lavamind
cc289f4c87 Merge branch 'master' into 'master'
Error out if cache directory does not exist when creating a fresh dup backup

See merge request riseuplabs/backupninja!15
2018-06-27 17:34:46 -07:00
Jerome Charaoui
1b1a857cbf Make sfdisk grep for luks headers more specific 2018-06-27 20:33:46 -04:00
lavamind
012dc70f60 Merge branch 'feature/support_luks_partitions' into 'master'
Support LUKS in disk partitions

See merge request riseuplabs/backupninja!13
2018-06-27 17:32:09 -07:00
lavamind
fb3b45343b Merge branch 'patch-1' into 'master'
Exclude zram devices, they don't have a partition table

See merge request riseuplabs/backupninja!12
2018-06-27 17:31:56 -07:00
lavamind
497ff73b65 Merge branch 'fix_11285' into 'master'
Attempt to sanitize the database identifiers, fix #11285

Closes #11285

See merge request riseuplabs/backupninja!11
2018-06-27 17:31:13 -07:00
Lyz
417394cf74
Changed /sed/@SED@/ 2018-06-25 16:31:16 +02:00
Jerome Charaoui
0d9b10890e [borg] use alternative repo ssh location syntax
This adds the ability to specify an alternative SSH port within
the host variable.
2018-06-06 22:03:24 -04:00
Hugh Nowlan
4725d7835f Correct path 2018-04-30 13:47:30 +01:00
Hugh Nowlan
f2bc6d60aa Error out if archive dir doesn't exist 2018-04-30 12:59:21 +01:00
Lyz
469a3fd5ab
Support LUKS in disk partitions 2018-04-30 12:29:23 +02:00
Glandos
90d0b9ff63 Exclude zram devices, they don't have a partition table 2018-03-24 06:23:26 -07:00
Jerome Charaoui
bc9be0d576 Attempt to sanitize the database identifiers
Removing the quote and semicolon characters should be sufficient to
prevent breaking out of the shell command, but this may need reviewed
by someone more knowlegeable in shell scripting.
2018-03-16 16:52:39 -04:00
Jerome Charaoui
0132b2453a [borg] scrap exclude*, add create_options
This allows the handler to fully make use of the advanced command-line
options for "borg create", such as the replaced "exclude*" options and
others like "--read-special" and "--numeric-owner".
2018-01-26 11:47:47 -05:00
Jerome Charaoui
e114ff68f4 [borg] remove unnecessary test on $keep 2018-01-26 11:37:04 -05:00
Jerome Charaoui
e9824c0d7d [borg] enable BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK
Otherwise the handler may hang, waiting for user input. This may occur
when the borg cache is deleted, or when borg is upgraded.
2018-01-26 11:32:04 -05:00
Jerome Charaoui
f43c85662d [borg] replace "keep*" options with simpler "keep"
The effect of "keep*" options is not straightforward to understand, so
replacing it with a simpler "keep" option, which replicates the
functionality of other backupninja handlers. This also simplifies the
helper, as the use is then only asked how many days of backups to keep.

At the same time, we add "prune_options" which allows for the use of the
"keep*" options as well as other useful prune options, like "--prefix".
2018-01-26 11:26:37 -05:00
Jerome Charaoui
fc0e0849dc [borg] add init option to allow skipping init command
In some cases it may be desirable to skip repository initialization, for
example when the repository is located at the root of a mount point.
2018-01-26 09:53:54 -05:00
Jerome Charaoui
a95457346e [borg] fix whitespace issue 2018-01-26 09:43:58 -05:00
Jerome Charaoui
6a3a8321f0 [borg] build/debug prunestr only if prune = yes 2018-01-26 09:43:58 -05:00
Jerome Charaoui
54cc8c6b32 [borg] support for --exclude-caches and --exclude-nodump 2018-01-26 09:43:58 -05:00
Jerome Charaoui
fcdbaa3447 [borg] add bwlimit config (sets --remote-ratelimit) 2018-01-26 09:43:58 -05:00
Jerome Charaoui
05f170760a [borg] next helper step should be selected in menu 2018-01-26 09:43:58 -05:00
Jerome Charaoui
830a00759f [borg] add 'prune' setting to allow disabling pruning 2018-01-26 09:43:58 -05:00
Jerome Charaoui
60601b2f4c [borg] consistent default in helper encryption section 2018-01-26 09:43:58 -05:00
Jerome Charaoui
a02a598bb5 [borg] change archive name to match borg default
Archive names must be unique, so if the backup runs more than once per
day with the previous default, it will throw and error because of the
duplicate archive name. This is also consistent with the addition of
the keephourly prune option.
2018-01-26 09:43:58 -05:00
Jerome Charaoui
245454b7dd [borg] fix default handler value for encryption 2018-01-26 09:43:58 -05:00
Jerome Charaoui
ce01329f01 [borg] fix final step completion check 2018-01-26 09:43:58 -05:00
Jerome Charaoui
0249e22598 [borg] Add return code to error message 2018-01-26 09:43:58 -05:00
Jerome Charaoui
61e1b31b72 [borg] fix ssh-copy-id when both keytypes exist 2018-01-26 09:43:58 -05:00
Jerome Charaoui
bb3cc0fc34 [borg] remove unnecessary proxy variable 2018-01-26 09:43:58 -05:00
Jerome Charaoui
bd4c3be7ae [borg] make indentation consistent with rest of file 2018-01-26 09:43:58 -05:00
Jerome Charaoui
fed1d85bdc [borg] fix helper when setting up without encryption 2018-01-26 09:43:58 -05:00
Jerome Charaoui
88adbaa990 [borg] support keephourly option 2018-01-26 09:43:58 -05:00
Ben
70873857b7 [borg] fixed connection testing (thanks @orel) 2018-01-26 09:43:58 -05:00
Ben
02d595baab [borg] added encryption support (credit to @mxroo and @leoberry) 2018-01-26 09:43:58 -05:00
Ben
23d8c68bf8 [borg] added copyright notices 2018-01-26 09:43:58 -05:00
Ben
95e43d5554 [borg] update handlers/Makefile.am 2018-01-26 09:43:58 -05:00
Ben
c4e9125a71 [borg] added a borg helper 2018-01-26 09:43:58 -05:00
Ben
02b6d883aa [borg] fixed pruning in test mode, don't actually run anything 2018-01-26 09:43:58 -05:00
Ben
ca8d479270 [borg] remove handlers/borg 2018-01-26 09:43:58 -05:00
Ben
060de6853a [borg] added support for local backups, without ssh (host=localhost) 2018-01-26 09:43:58 -05:00
Ben
2e6d94d89a [borg] added borg handler and example straight from @maethor gists 2018-01-26 09:43:58 -05:00
intrigeri
e0b4375400 Quote command output strings passed to logging functions.
Thanks to @Gackiewicz for the report!

Closes #11278
2018-01-10 10:44:33 +00:00
intrigeri
b15e5f6b80 Merge branch 'master' into 'master'
#11273: Exclude partitions from device list

Closes #11273

See merge request riseuplabs/backupninja!7
2018-01-10 02:13:33 -08:00
Matthijs Wensveen
af2b8d0b62 Symmetric encryption in dup handler is broken (#11274) 2017-10-12 11:20:31 +02:00
Romain Dessort
dff9ac99c5 Close #11273. Exclude partitions from device list
Use lsblk instead of sfdisk to get a list of block devices on the host.
2017-09-28 13:58:53 -04:00
intrigeri
0356db5dcc Documentation: bandwidthlimit for the dup handler needs to be given in KB/s, and not (as wrongly advertised previously) in Kbit/s.
Closes: #7603
2017-08-12 22:10:29 +00:00
intrigeri
a3ee78c057 Merge branch 'mysql' into 'master'
#11148: skip dumping information|performance_schema in mysql handler

See merge request !5
2017-08-12 18:17:36 +00:00
ibauer
711ea76dd1 #11148: skip dumping information|performance_schema in mysql handler
- Escaped single quotes as described in https://stackoverflow.com/questions/1250079/how-to-escape-single-quotes-within-single-quoted-strings
2017-08-03 15:30:51 +02:00
ibauer
436e57ec29 #11148: skip dumping information|performance_schema in mysql handler
- Replaced nested single quotes with escaped double quotes
2017-07-28 10:54:32 +02:00
intrigeri
f8e1664e01 dup handler: correctly handle Dropbox access token (Closes: #11260).
Thanks to Daniel Lo Nigro for the patch.
2017-07-25 09:55:13 +00:00
ibauer
7d7d853123 #11148: skip dumping information|performance_schema in mysql handler
- Removed escaping as it is not needed and wrong
2017-07-21 16:47:20 +02:00
ibauer
44a7ee8912 #11148: skip dumping information|performance_schema in mysql handler 2017-07-21 16:12:39 +02:00
Micah Anderson
41c3544ed5 dsync: the dsync handler incorrectly would test for >3 failures before
emitting the failure message, it should do so at =>3
2015-03-30 12:23:50 -04:00
Silvio Rhatto
3094b04da5 Rsync: check test mode should set proper dest path (#8196) 2014-11-07 15:16:30 -02:00
Silvio Rhatto
89860aa3f6 Rsync: check test mode also in prepare_storage (#8196) 2014-11-07 14:36:25 -02:00
Silvio Rhatto
c649339ba4 Rsync: support for backupninja's test option (#8196) 2014-11-05 11:18:11 -02:00
intrigeri
9b37f756f5 Exclude tmpfs filesystems from df output in the sys handler (Closes: Debian#745818). 2014-05-03 14:08:04 +00:00
intrigeri
8db80421aa Fix indentation in sys handler.
Thanks to Jools Wills <jools@oxfordinspire.co.uk> for the patch.
2014-05-03 13:45:51 +00:00
intrigeri
14eed7f751 Remove spurious quotes that broke the sys helper (Closes: Redmine#6803).
Thanks to Jools Wills <jools@oxfordinspire.co.uk> for the patch.
2014-05-03 13:38:45 +00:00
intrigeri
179eb70b8c Merge remote-tracking branch 'sarava/bug/3003'
Conflicts:
	handlers/rsync.in
2014-05-03 13:24:08 +00:00
intrigeri
9e1d98a253 Merge remote-tracking branch 'sarava/bug/3929' 2014-05-03 13:20:21 +00:00
Christian Prause
8ed2f8de3f Added suse to the list of supported OS 2014-05-03 13:12:10 +00:00
intrigeri
ed864a64e3 Run duplicity in a C locales environment (Closes: #736280).
This workarounds a bug in duplicity. Quoting the reporter (thanks, Jonathan
Dupart <jonathan@dupart.org>, for the detailed report and initial patch):

The duplicity backend is broken when the gpg ecryption is set up and the
system default locale is not english (or C).

The bug reports on duplicity are here :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=565398
https://bugs.launchpad.net/duplicity/+bug/510625
2014-03-01 11:56:11 +00:00
Dominik George
c5738b11d9 Added SIGN_PASSPHRASE support for dup handler. 2014-02-22 14:56:58 +00:00
intrigeri
1017ec315f dup: Fix buggy version comparison. (Redmine#6746) 2014-02-22 14:23:22 +00:00
intrigeri
1a762885e2 Make logic consistent with what we're using elsewhere.
Without this change, e.g. 0.5.20 would not get --extra-clean, while it should.
Granted, the new test is buggy too, e.g. 0.7.1 will get --extra-clean,
while it should not. Will report that to Redmine.
2014-02-22 13:41:43 +00:00
Alexander Mette
e27654df5c Fix #6357 - Don't remove useful signature files
duplicity >=0.6.20 now correctly removes useless signature files and
therefore the cache directory doesn't grow infinitely any more. Using
--extra-clean removes all signatures except from the last chain and so
renders older chains unusable, don't use it by default any more.
See: https://bugs.launchpad.net/duplicity/+bug/519948
2014-02-22 13:39:27 +00:00
intrigeri
e96a894bb8 mysql: fix non-qualified table name extraction (Closes: Redmine#4373). 2014-02-22 13:34:57 +00:00
intrigeri
ce4db5dd4f rdiff.helper: don't give misleading information regarding required fields (Closes: Redmine#4410). 2014-02-22 13:11:49 +00:00
intrigeri
29e2c75ede mysql: make "nodata" option compatible with compress=no. 2013-12-26 15:42:22 +00:00
Silvio Rhatto
b8b8b46fba Solve quoting issue with "su" (debian #683731) (upstream #4019)
A fix for debian #677410 on commit 29dcdbae introduces a new issue on wheezy
machines where some rsync_options gets out of the rsync command quotes when
invoked by su.

As reported, running backupninja through `bash -x` shows that the `--delete`
option from the rsync command is not included in the single quote for the `su
-c` command:

    nice -n 0 su -c '/usr/bin/rsync -av' --delete '--recursive
    --delete-excluded    //home/ /tmp/test//home//'

This patch attempt to solve that issue by using the intermediary variable
$command.
2013-10-26 13:18:19 -02:00
intrigeri
0cb6fcd647 Delete trailing whitespace. 2013-09-23 10:19:26 +00:00
Micah Anderson
54ec07be55 add additional sys backup options to provide the ability to backup the MBR for every device found, and to backup the BIOS (if the flashrom program is installed, and the mainboard is supported) 2013-09-20 16:48:13 -04:00
Micah Anderson
373c6bcced fix capitalization of LUKS 2013-09-20 13:45:57 -04:00
Micah Anderson
be4456ae3f fix missing autoconf marker for @SED@ 2013-09-20 13:45:10 -04:00
Micah Anderson
0df3c9939d fix luks header backup to properly detect partitions
previously the code was modeled off of the partition backup methodology, this resulted in the code only attempting to detect luks on actual devices, and not on partitions. The code would step through every disk on the system (sda, sdb, etc.) and do a 'cryptsetup isLuks' on that device, and then based on that output save the luks header for any device that had one. Unfortunately, in many cases, luks headers are found on the partitions of those disks. So we were failing to detect any luks partitions and thus failing to backup their luks headers.

this commit changes that, it now will look for luks headers on the devices themselves (for cases where a full disk is used without partitions), and on any partitions that are detected
2013-09-20 13:44:11 -04:00
intrigeri
7a5045baf1 dup: Gracefully handle legacy spaces between -o and IdentityFile. 2013-07-23 12:01:37 +02:00