Compare commits

...

157 Commits

Author SHA1 Message Date
62d7835018 Add ntfy warning 2023-03-31 11:47:54 +02:00
caba5f8291 Update schema comment for check_repositories to mention labels (#635). 2023-03-31 11:46:38 +02:00
fcdd839278 Add missing Docker Compose depends. 2023-03-31 11:46:38 +02:00
daa0daab1b Remove unnecessary cd in dev documentation. 2023-03-31 11:46:38 +02:00
458b868371 Fix Drone intentation. 2023-03-31 11:46:38 +02:00
e105799296 Error out if run-full-tests is run not inside a test container. 2023-03-31 11:46:38 +02:00
be1e483e66 Add check_repositories regression fix to NEWS (#662). 2023-03-31 11:46:38 +02:00
ce040a1a2b add and update tests 2023-03-31 11:46:38 +02:00
fb92e1aec4 reformat 2023-03-31 11:46:38 +02:00
6de48fa5d8 fix: make check repositories work with dict and str repositories 2023-03-31 11:46:38 +02:00
85c62625c7 Update script comment. 2023-03-31 11:46:38 +02:00
174ebcc99c Update OpenBSD borgmatic link. 2023-03-31 11:46:38 +02:00
3553cb0500 I had one job... (#461). 2023-03-31 11:46:38 +02:00
f6266160f9 Document that most command-line flags are not config-file-able (#461). 2023-03-31 11:46:38 +02:00
eeb3cafe71 Fix multiple repositories example. 2023-03-31 11:46:38 +02:00
11798edc15 Mention prior versions of borgmatic in repositories schema. 2023-03-31 11:46:38 +02:00
cbc6957a11 Update docs with a few more "path:" repositories references (#635). 2023-03-31 11:46:38 +02:00
f8a81419c4 Fix repository schema description. 2023-03-31 11:46:38 +02:00
7adddb5a12 Bump version for release. 2023-03-31 11:46:38 +02:00
84a0ab3d18 Add optional repository labels so you can select a repository via "--repository yourlabel" at the command-line (#635). 2023-03-31 11:46:38 +02:00
5711151ad7 add feature to docs 2023-03-31 11:46:38 +02:00
c53455c49d add tests for repo labels 2023-03-31 11:46:38 +02:00
698468e322 rename repository arg to repository_path in all borg actions 2023-03-31 11:46:38 +02:00
71296cfa0d check all tests 2023-03-31 11:46:38 +02:00
6be334d388 remove optional label for repos from tests 2023-03-31 11:46:38 +02:00
0aa554cfa5 reformat 2023-03-31 11:46:36 +02:00
74abc19df6 pass all tests 2023-03-31 11:45:34 +02:00
4c8600aa5d use repository["path"] instead of repository 2023-03-31 11:45:02 +02:00
31b552df68 reformat base 2023-03-31 11:37:04 +02:00
f2b2b3c984 feat: tag repos 2023-03-31 11:37:02 +02:00
1d79fa3910 When a database command errors, display and log the error message instead of swallowing it (#396). 2023-03-31 11:36:15 +02:00
c0ab5ae422 Removing debugging command output. 2023-03-31 11:36:15 +02:00
b1c6217047 Add troubleshooting documentation on PostgreSQL/MySQL authentication errors. 2023-03-31 11:36:15 +02:00
bc662720df Add additional documentation link to environment variable feature. Rename constants section. 2023-03-31 11:36:15 +02:00
1f7f31098d Add documentation and NEWS for custom constants feature (#612). 2023-03-31 11:36:15 +02:00
df85d3e8d1 fix: replace primitive values in config without quotes 2023-03-31 11:36:15 +02:00
b48710b544 reformat 2023-03-31 11:36:15 +02:00
d5ad78d9af add test for complex constant 2023-03-31 11:36:15 +02:00
0ae811c25d feat: constants support 2023-03-31 11:36:15 +02:00
4582cf5244 Hide obnoxious ruamel.yaml warnings during test runs. 2023-03-31 11:36:15 +02:00
8edd5db1cb Rename scripts/run-full-dev-tests to scripts/run-end-to-end-dev-tests and make it run end-to-end tests only. 2023-03-31 11:36:15 +02:00
9e037af926 fix: docs cli reference create spelling 2023-03-31 11:36:15 +02:00
646370e675 Add documentation on backing up a database running in a container (#649). 2023-03-31 11:36:15 +02:00
7d1b8ed393 Add code style plugins to enforce use of Python f-strings and prevent single-letter variables. 2023-03-31 11:36:15 +02:00
87bdc68fcd end with newline 2023-03-31 11:36:15 +02:00
0940e9511d fix: remove extra links from docs css 2023-03-31 11:36:15 +02:00
80091230d6 docs: copy to clipboard support 2023-03-31 11:36:15 +02:00
81c81792f7 Add missing source directory error fix to NEWS (#655). 2023-03-31 11:36:15 +02:00
a0810671bd review 2023-03-31 11:36:15 +02:00
c1a15d4cb4 remove extra parameter from function call 2023-03-31 11:36:15 +02:00
9bff81ed1f use exit_code_indicates_error and modify it to accept a command 2023-03-31 11:36:13 +02:00
419678e0a3 fix: no error on database backups without source dirs 2023-03-31 11:35:34 +02:00
9af87e7035 Add confusing error message fix to NEWS (#623). 2023-03-31 11:35:34 +02:00
baec8acbf8 fix: rephrase error when running from config
to avoid confusion, as the user might think the problem is with their config file
2023-03-31 11:35:34 +02:00
a241b8a38b Remove unused module and outdated test expectations (#576). 2023-03-31 11:35:34 +02:00
72effb99b1 Add "file://" paths to NEWS (#576). 2023-03-31 11:35:34 +02:00
f4b3681013 add tests and remove magic number 2023-03-31 11:35:34 +02:00
300d9b9dc4 Add NixOS package link to installation docs. 2023-03-31 11:35:34 +02:00
52a64f6a2c Add "source_directories_must_exist" option to NEWS (#501). 2023-03-31 11:35:34 +02:00
91a916967c reformat 2023-03-31 11:35:34 +02:00
58798e0592 add tests 2023-03-31 11:35:34 +02:00
d0dce1c362 feat: add optional check for existence of source directories 2023-03-31 11:35:34 +02:00
ed15ea932b Add "borg_files_cache_ttl" option to NEWS. 2023-03-31 11:35:34 +02:00
e1a182418a add test to ensure integers are converted to string
before setting them up to be environment variable values

Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-03-31 11:35:34 +02:00
26c83d1f62 add option to set borg_files_cache_ttl in config
Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-03-31 11:35:34 +02:00
0782ca6aef Clarify check frequency default behavior (#653). 2023-03-31 11:35:34 +02:00
f0e92591cc Bump version for release. 2023-03-31 11:35:34 +02:00
0ada19b444 Add support for Python 3.11. 2023-03-31 11:35:34 +02:00
7129e20141 Add "--repository" flag to all actions where it makes sense (#564). 2023-03-31 11:35:34 +02:00
Nain
44f9e2d723 Update tests
Make them more explicit. Also formatting.
2023-03-31 11:35:34 +02:00
Nain
5c89ad6eda Add "--repository" flag to the "create" action 2023-03-31 11:35:34 +02:00
Nain
a0dbe93554 Add "--repository" flag to the "compact" action 2023-03-31 11:35:34 +02:00
Nain
5af6d784bd Add "--repository" flag to the "check" action 2023-03-31 11:35:34 +02:00
Nain
9ded51b78a Merge mostly repetetive tests 2023-03-31 11:35:34 +02:00
Nain
667a40cb0b Remove test now that --repository isn't expected to error
As discussed #652#issuecomment-5579
2023-03-31 11:35:34 +02:00
Nain
c804793453 Add "--repository" flag to the "prune" action
part of ticket #564
2023-03-31 11:35:34 +02:00
Nain
ef7b4c33ce Better indicate position of additional docs on page
On wide screens, the position of the documentation (how-to and reference guide)
is at same level as #it's-your-data.-keep-it-that-way.

So the jump due to anchor link makes it seem like we're taken to top aka
main content. Indicate that links are to the left so reader doesn't recurse.
2023-03-31 11:35:34 +02:00
dc2b1ff8d2 Fix --editable (mode) option given --user as arg
--user option should be before, or after `--editable .` not in between.
Before seems better.
2023-03-31 11:35:34 +02:00
9f1d183712 Add "--strip-components all" on the "extract" action to remove leading path components (#647). 2023-03-31 11:35:34 +02:00
6bf858aae2 Document how to list database dumps in an archive. 2023-03-31 11:35:33 +02:00
Jelle @ Samson-IT
4386e66f65 reworded and added 'all' caveat 2023-03-31 11:35:33 +02:00
Jelle @ Samson-IT
1cf4a91b0a Added some info about fetching mysql database size 2023-03-31 11:35:33 +02:00
9fa57b3190 Change the default action order to: "create", "prune", "compact", "check" (#304). 2023-03-31 11:35:33 +02:00
15ca234349 Run any command-line actions in the order specified instead of using a fixed ordering (#304). 2023-03-31 11:35:33 +02:00
fc9bf03409 Add Healthchecks "log" state feature to NEWS. 2023-03-31 11:35:33 +02:00
e66afc8d8a fix tests
Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-03-31 11:35:33 +02:00
8cac207fc6 added tests to make sure unsupported log states are detected
Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-03-31 11:35:33 +02:00
e4fe56f526 return early if unsupported state is passed
Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-03-31 11:35:33 +02:00
e3c46d0084 fix logs_monitor_start_error()
Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-03-31 11:35:33 +02:00
4ef65a5411 update test_borgmatic.py
Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-03-31 11:35:32 +02:00
850021b749 add test for healthchecks
Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-03-31 11:35:29 +02:00
49564585dd update schema.yaml description
also add monitor.State.LOG to cronitor.

Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-03-31 11:34:42 +02:00
01b4d7c27e Add support for healthchecks "log" feature #628
Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
2023-03-31 11:34:39 +02:00
dbb39d0b10 Add flake8-quotes to complain about incorrect quoting so I don't have to! 2023-03-31 11:33:18 +02:00
cd003f11dd Mention searching for files in the extract a backup guide. 2023-03-31 11:33:18 +02:00
ba71509bba Update dates in documentation examples. 2023-03-31 11:33:18 +02:00
b0a1ba867c send repo directly to extract and export_tar 2023-03-31 11:33:18 +02:00
13c16dd8f7 feat: file:// URLs support 2023-03-31 11:33:18 +02:00
fa99471e3e fix: remove extra dark mode styles 2023-03-31 11:33:18 +02:00
1e8148575c In the documentation, mention what version of borgmatic introduced SQLite support. 2023-03-31 11:33:18 +02:00
6948aa957f Add SQLite feature to NEWS and also integrations. 2023-03-31 11:33:18 +02:00
61f1c9603c remove test path 2023-03-31 11:33:18 +02:00
d854d40472 mock os.remove instead of actually removing a file 2023-03-31 11:33:18 +02:00
1804967bdc use os.remove and improve tests 2023-03-31 11:33:18 +02:00
338a4cea29 add sqlite for e2e tests 2023-03-31 11:33:18 +02:00
41b3975198 e2e tests schema update 2023-03-31 11:33:18 +02:00
f8f9debee8 code review 2023-03-31 11:33:18 +02:00
c80f3c8265 formatting fix 2023-03-31 11:33:18 +02:00
4231405c80 feat: add dump-restore support for sqlite databases 2023-03-31 11:33:17 +02:00
15d408d7cf Bump version for release. 2023-03-31 11:33:17 +02:00
228f55a1de With the "create" action and the "--list" ("--files") flag, only show excluded files at verbosity 2 (#620). 2023-03-31 11:33:17 +02:00
7beb935122 Add "checkpoint_volume" configuration option to creates checkpoints every specified number of bytes. 2023-03-31 11:33:17 +02:00
37a32b0943 Fix tests. 2023-03-31 11:33:17 +02:00
24331d917c Add "--repository" flag to the "rcreate" action. Add "--progress" flag to the "transfer" action. 2023-03-31 11:33:17 +02:00
52889c646f Support status character changes in Borg 2.0.0b5 when filtering out special files that cause Borg to hang. 2023-03-31 11:33:17 +02:00
49950c2c77 Fix the "create" action with the "--dry-run" flag querying for databases when a PostgreSQL/MySQL "all" database is configured. 2023-03-31 11:33:17 +02:00
a66542cce1 Internally support new Borg 2.0.0b5 "--filter" status characters / item flags for the "create" action. 2023-03-31 11:33:17 +02:00
ee8535f577 With the "create" action, only one of "--list" ("--files") and "--progress" flags can be used. 2023-03-31 11:33:17 +02:00
9071b14dcf Update Borg 2.0 documentation links. 2023-03-31 11:33:17 +02:00
713ed66337 Add ntfy authentication to NEWS. 2023-03-31 11:33:17 +02:00
608dbcedc7 Add auth test for the ntfy hook 2023-03-31 11:33:17 +02:00
67ed746024 Make the auth logic more explicit and warnings if necessary 2023-03-31 11:33:17 +02:00
3e8236c26e Add authentication to the ntfy hook 2023-03-31 11:33:17 +02:00
6bdb1974cf Add MySQL database hook "add_drop_database" configuration option to control whether dumped MySQL databases get dropped right before restore (#642). 2023-03-31 11:33:17 +02:00
339ffc9c22 Fix for potential data loss (data not getting backed up) when dumping large "directory" format PostgreSQL/MongoDB databases (#643). 2023-03-31 11:33:17 +02:00
Clemens Lang
16da97d75d setup: Add link to MacPorts package 2023-03-31 11:33:17 +02:00
db13217361 Clarify "checks" configuration documentation for older versions of borgmatic (#639). 2023-03-31 11:33:17 +02:00
f152e33f35 Remove related documentation links. 2023-03-31 11:33:17 +02:00
7ae1eac0df Upgrade documentation image dependencies. 2023-03-31 11:33:17 +02:00
0241d56131 Clarify NEWS on database "all" dump feature applying to MySQL as well. 2023-03-31 11:33:17 +02:00
1c2ef7b24d Bump version for release. 2023-03-31 11:33:17 +02:00
1f12bf6461 Fix code style flake issue. 2023-03-31 11:33:17 +02:00
2cf1ed57c0 Add configuration options for database command customization (#630). 2023-03-31 11:33:17 +02:00
deb46b0a70 Update documentation about changes to "all" database restores (#438, #560). 2023-03-31 11:33:17 +02:00
25df602a47 Optionally dump "all" PostgreSQL databases to separate files instead of one combined dump file (#438, #560). 2023-03-31 11:33:17 +02:00
7564a27dfc Mention "before_actions" command hook in soft failure documentation (#631). 2023-03-31 11:33:17 +02:00
62109adfb0 Add NEWS entry for #629. 2023-03-31 11:33:17 +02:00
palto42
abcd017e3e conditional warning for excluding special files 2023-03-31 11:33:17 +02:00
bf3d364ac4 Lowercase borgmatic in documentation. 2023-03-31 11:33:17 +02:00
c2622a4199 add borgmatic minimum version to compact docs 2023-03-31 11:33:17 +02:00
1e3fd59ce6 Fix traceback when include merging on ARM64 (#622). 2023-03-31 11:33:17 +02:00
8f4c8200a6 Update borgmatic social links. 2023-03-31 11:33:17 +02:00
a97dc48fee Optionally dump "all" PostgreSQL databases to separate files instead of one combined dump file (#438, #560). 2023-03-31 11:33:17 +02:00
c54e6b319f Update developer constributing instructions as well. 2023-03-31 11:33:17 +02:00
e96ad5b854 Update developer instructions. 2023-03-31 11:33:17 +02:00
a4111cc417 Clarify data/archives check implicit enabling. 2023-03-31 11:33:17 +02:00
90fb6f5b9e Clarify documentation about transferring archives between related repositories. 2023-03-31 11:33:17 +02:00
7e49b63a26 Fix logs that interfere with JSON output by making warnings go to stderr instead of stdout (#602). 2023-03-31 11:33:17 +02:00
df2c34c260 Bump version for release. 2023-03-31 11:33:17 +02:00
3ee7d502d3 Clarify documentation about multiple repositories and separate configuration files (#613). 2023-03-31 11:33:17 +02:00
e252f44696 Upgrade pytest test dependency (security). 2023-03-31 11:33:17 +02:00
58e3869dbd Code formatting. 2023-03-31 11:33:17 +02:00
Javier Paniagua
781e479966 specify pg dump/restore commands (#311) 2023-03-31 11:33:17 +02:00
3113aaba27 Fix "data" consistency check to support "check_last" and consistency "prefix" options (#611). 2023-03-31 11:33:17 +02:00
e5c762419c More consistency checks documentation edits. 2023-03-31 11:33:17 +02:00
85a60ffa15 Clarify consistency check configuration. 2023-03-31 11:33:17 +02:00
1c00954969 Clarify examples in include merging and deep merging documentation (#607). 2023-03-31 11:33:17 +02:00
158 changed files with 6786 additions and 2395 deletions

View File

@ -24,6 +24,8 @@ clone:
steps:
- name: build
image: alpine:3.13
environment:
TEST_CONTAINER: true
pull: always
commands:
- scripts/run-full-tests

View File

@ -1,4 +1,5 @@
const pluginSyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const codeClipboard = require("eleventy-plugin-code-clipboard");
const inclusiveLangPlugin = require("@11ty/eleventy-plugin-inclusive-language");
const navigationPlugin = require("@11ty/eleventy-navigation");
@ -6,6 +7,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(pluginSyntaxHighlight);
eleventyConfig.addPlugin(inclusiveLangPlugin);
eleventyConfig.addPlugin(navigationPlugin);
eleventyConfig.addPlugin(codeClipboard);
let markdownIt = require("markdown-it");
let markdownItAnchor = require("markdown-it-anchor");
@ -31,6 +33,7 @@ module.exports = function(eleventyConfig) {
markdownIt(markdownItOptions)
.use(markdownItAnchor, markdownItAnchorOptions)
.use(markdownItReplaceLink)
.use(codeClipboard.markdownItCopyButton)
);
eleventyConfig.addPassthroughCopy({"docs/static": "static"});

1
.flake8 Normal file
View File

@ -0,0 +1 @@
select = Q0

83
NEWS
View File

@ -1,5 +1,86 @@
1.7.5.dev0
1.7.11.dev0
* #662: Fix regression in which "check_repositories" option failed to match repositories.
1.7.10
* #396: When a database command errors, display and log the error message instead of swallowing it.
* #501: Optionally error if a source directory does not exist via "source_directories_must_exist"
option in borgmatic's location configuration.
* #576: Add support for "file://" paths within "repositories" option.
* #612: Define and use custom constants in borgmatic configuration files. See the documentation for
more information:
https://torsion.org/borgmatic/docs/how-to/make-per-application-backups/#constant-interpolation
* #618: Add support for BORG_FILES_CACHE_TTL environment variable via "borg_files_cache_ttl" option
in borgmatic's storage configuration.
* #623: Fix confusing message when an error occurs running actions for a configuration file.
* #635: Add optional repository labels so you can select a repository via "--repository yourlabel"
at the command-line. See the configuration reference for more information:
https://torsion.org/borgmatic/docs/reference/configuration/
* #649: Add documentation on backing up a database running in a container:
https://torsion.org/borgmatic/docs/how-to/backup-your-databases/#containers
* #655: Fix error when databases are configured and a source directory doesn't exist.
* Add code style plugins to enforce use of Python f-strings and prevent single-letter variables.
To join in the pedantry, refresh your test environment with "tox --recreate".
* Rename scripts/run-full-dev-tests to scripts/run-end-to-end-dev-tests and make it run end-to-end
tests only. Continue using tox to run unit and integration tests.
1.7.9
* #295: Add a SQLite database dump/restore hook.
* #304: Change the default action order when no actions are specified on the command-line to:
"create", "prune", "compact", "check". If you'd like to retain the old ordering ("prune" and
"compact" first), then specify actions explicitly on the command-line.
* #304: Run any command-line actions in the order specified instead of using a fixed ordering.
* #564: Add "--repository" flag to all actions where it makes sense, so you can run borgmatic on
a single configured repository instead of all of them.
* #628: Add a Healthchecks "log" state to send borgmatic logs to Healthchecks without signalling
success or failure.
* #647: Add "--strip-components all" feature on the "extract" action to remove leading path
components of files you extract. Must be used with the "--path" flag.
* Add support for Python 3.11.
1.7.8
* #620: With the "create" action and the "--list" ("--files") flag, only show excluded files at
verbosity 2.
* #621: Add optional authentication to the ntfy monitoring hook.
* With the "create" action, only one of "--list" ("--files") and "--progress" flags can be used.
This lines up with the new behavior in Borg 2.0.0b5.
* Internally support new Borg 2.0.0b5 "--filter" status characters / item flags for the "create"
action.
* Fix the "create" action with the "--dry-run" flag querying for databases when a PostgreSQL/MySQL
"all" database is configured. Now, these queries are skipped due to the dry run.
* Add "--repository" flag to the "rcreate" action to optionally select one configured repository to
create.
* Add "--progress" flag to the "transfer" action, new in Borg 2.0.0b5.
* Add "checkpoint_volume" configuration option to creates checkpoints every specified number of
bytes during a long-running backup, new in Borg 2.0.0b5.
1.7.7
* #642: Add MySQL database hook "add_drop_database" configuration option to control whether dumped
MySQL databases get dropped right before restore.
* #643: Fix for potential data loss (data not getting backed up) when dumping large "directory"
format PostgreSQL/MongoDB databases. Prior to the fix, these dumps would not finish writing to
disk before Borg consumed them. Now, the dumping process completes before Borg starts. This only
applies to "directory" format databases; other formats still stream to Borg without using
temporary disk space.
* Fix MongoDB "directory" format to work with mongodump/mongorestore without error. Prior to this
fix, only the "archive" format worked.
1.7.6
* #393, #438, #560: Optionally dump "all" PostgreSQL/MySQL databases to separate files instead of
one combined dump file, allowing more convenient restores of individual databases. You can enable
this by specifying the database dump "format" option when the database is named "all".
* #602: Fix logs that interfere with JSON output by making warnings go to stderr instead of stdout.
* #622: Fix traceback when include merging configuration files on ARM64.
* #629: Skip warning about excluded special files when no special files have been excluded.
* #630: Add configuration options for database command customization: "list_options",
"restore_options", and "analyze_options" for PostgreSQL, "restore_options" for MySQL, and
"restore_options" for MongoDB.
1.7.5
* #311: Override PostgreSQL dump/restore commands via configuration options.
* #604: Fix traceback when a configuration section is present but lacking any options.
* #607: Clarify documentation examples for include merging and deep merging.
* #611: Fix "data" consistency check to support "check_last" and consistency "prefix" options.
* #613: Clarify documentation about multiple repositories and separate configuration files.
1.7.4
* #596: Fix special file detection erroring when broken symlinks are encountered.

View File

@ -24,9 +24,10 @@ location:
# Paths of local or remote repositories to backup to.
repositories:
- ssh://1234@usw-s001.rsync.net/./backups.borg
- ssh://k8pDxu32@k8pDxu32.repo.borgbase.com/./repo
- /var/lib/backups/local.borg
- path: ssh://k8pDxu32@k8pDxu32.repo.borgbase.com/./repo
label: borgbase
- path: /var/lib/backups/local.borg
label: local
retention:
# Retention policy for how many backups to keep.
@ -67,6 +68,7 @@ borgmatic is powered by [Borg Backup](https://www.borgbackup.org/).
<a href="https://www.mysql.com/"><img src="docs/static/mysql.png" alt="MySQL" height="60px" style="margin-bottom:20px;"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://mariadb.com/"><img src="docs/static/mariadb.png" alt="MariaDB" height="60px" style="margin-bottom:20px;"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://www.mongodb.com/"><img src="docs/static/mongodb.png" alt="MongoDB" height="60px" style="margin-bottom:20px;"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://sqlite.org/"><img src="docs/static/sqlite.png" alt="SQLite" height="60px" style="margin-bottom:20px;"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://healthchecks.io/"><img src="docs/static/healthchecks.png" alt="Healthchecks" height="60px" style="margin-bottom:20px;"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://cronitor.io/"><img src="docs/static/cronitor.png" alt="Cronitor" height="60px" style="margin-bottom:20px;"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://cronhub.io/"><img src="docs/static/cronhub.png" alt="Cronhub" height="60px" style="margin-bottom:20px;"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -80,8 +82,8 @@ borgmatic is powered by [Borg Backup](https://www.borgbackup.org/).
Your first step is to [install and configure
borgmatic](https://torsion.org/borgmatic/docs/how-to/set-up-backups/).
For additional documentation, check out the links above for <a
href="https://torsion.org/borgmatic/#documentation">borgmatic how-to and
For additional documentation, check out the links above (left panel on wide screens)
for <a href="https://torsion.org/borgmatic/#documentation">borgmatic how-to and
reference guides</a>.
@ -104,23 +106,38 @@ offerings, but do not currently fund borgmatic development or hosting.
### Issues
You've got issues? Or an idea for a feature enhancement? We've got an [issue
tracker](https://projects.torsion.org/borgmatic-collective/borgmatic/issues). In order to
create a new issue or comment on an issue, you'll need to [login
first](https://projects.torsion.org/user/login). Note that you can login with
an existing GitHub account if you prefer.
If you'd like to chat with borgmatic developers or users, head on over to the
`#borgmatic` IRC channel on Libera Chat, either via <a
href="https://web.libera.chat/#borgmatic">web chat</a> or a
native <a href="ircs://irc.libera.chat:6697">IRC client</a>. If you
don't get a response right away, please hang around a while—or file a ticket
instead.
Are you experiencing an issue with borgmatic? Or do you have an idea for a
feature enhancement? Head on over to our [issue
tracker](https://projects.torsion.org/borgmatic-collective/borgmatic/issues).
In order to create a new issue or add a comment, you'll need to
[register](https://projects.torsion.org/user/sign_up?invite_code=borgmatic)
first. If you prefer to use an existing GitHub account, you can skip account
creation and [login directly](https://projects.torsion.org/user/login).
Also see the [security
policy](https://torsion.org/borgmatic/docs/security-policy/) for any security
issues.
### Social
Check out the [Borg subreddit](https://www.reddit.com/r/BorgBackup/) for
general Borg and borgmatic discussion and support.
Also follow [borgmatic on Mastodon](https://fosstodon.org/@borgmatic).
### Chat
To chat with borgmatic developers or users, check out the `#borgmatic`
IRC channel on Libera Chat, either via <a
href="https://web.libera.chat/#borgmatic">web chat</a> or a native <a
href="ircs://irc.libera.chat:6697">IRC client</a>. If you don't get a response
right away, please hang around a while—or file a ticket instead.
### Other
Other questions or comments? Contact
[witten@torsion.org](mailto:witten@torsion.org).
@ -135,10 +152,14 @@ borgmatic is licensed under the GNU General Public License version 3 or any
later version.
If you'd like to contribute to borgmatic development, please feel free to
submit a [Pull Request](https://projects.torsion.org/borgmatic-collective/borgmatic/pulls)
or open an [issue](https://projects.torsion.org/borgmatic-collective/borgmatic/issues) first
to discuss your idea. We also accept Pull Requests on GitHub, if that's more
your thing. In general, contributions are very welcome. We don't bite!
submit a [Pull
Request](https://projects.torsion.org/borgmatic-collective/borgmatic/pulls) or
open an
[issue](https://projects.torsion.org/borgmatic-collective/borgmatic/issues) to
discuss your idea. Note that you'll need to
[register](https://projects.torsion.org/user/sign_up?invite_code=borgmatic)
first. We also accept Pull Requests on GitHub, if that's more your thing. In
general, contributions are very welcome. We don't bite!
Also, please check out the [borgmatic development
how-to](https://torsion.org/borgmatic/docs/how-to/develop-on-borgmatic/) for

View File

36
borgmatic/actions/borg.py Normal file
View File

@ -0,0 +1,36 @@
import logging
import borgmatic.borg.borg
import borgmatic.borg.rlist
import borgmatic.config.validate
logger = logging.getLogger(__name__)
def run_borg(
repository, storage, local_borg_version, borg_arguments, local_path, remote_path,
):
'''
Run the "borg" action for the given repository.
'''
if borg_arguments.repository is None or borgmatic.config.validate.repositories_match(
repository, borg_arguments.repository
):
logger.info('{}: Running arbitrary Borg command'.format(repository['path']))
archive_name = borgmatic.borg.rlist.resolve_archive_name(
repository['path'],
borg_arguments.archive,
storage,
local_borg_version,
local_path,
remote_path,
)
borgmatic.borg.borg.run_arbitrary_borg(
repository['path'],
storage,
local_borg_version,
options=borg_arguments.options,
archive=archive_name,
local_path=local_path,
remote_path=remote_path,
)

View File

@ -0,0 +1,25 @@
import logging
import borgmatic.borg.break_lock
import borgmatic.config.validate
logger = logging.getLogger(__name__)
def run_break_lock(
repository, storage, local_borg_version, break_lock_arguments, local_path, remote_path,
):
'''
Run the "break-lock" action for the given repository.
'''
if break_lock_arguments.repository is None or borgmatic.config.validate.repositories_match(
repository, break_lock_arguments.repository
):
logger.info(f'{repository["path"]}: Breaking repository and cache locks')
borgmatic.borg.break_lock.break_lock(
repository['path'],
storage,
local_borg_version,
local_path=local_path,
remote_path=remote_path,
)

View File

@ -0,0 +1,61 @@
import logging
import borgmatic.borg.check
import borgmatic.config.validate
import borgmatic.hooks.command
logger = logging.getLogger(__name__)
def run_check(
config_filename,
repository,
location,
storage,
consistency,
hooks,
hook_context,
local_borg_version,
check_arguments,
global_arguments,
local_path,
remote_path,
):
'''
Run the "check" action for the given repository.
'''
if check_arguments.repository and not borgmatic.config.validate.repositories_match(
repository, check_arguments.repository
):
return
borgmatic.hooks.command.execute_hook(
hooks.get('before_check'),
hooks.get('umask'),
config_filename,
'pre-check',
global_arguments.dry_run,
**hook_context,
)
logger.info('{}: Running consistency checks'.format(repository['path']))
borgmatic.borg.check.check_archives(
repository['path'],
location,
storage,
consistency,
local_borg_version,
local_path=local_path,
remote_path=remote_path,
progress=check_arguments.progress,
repair=check_arguments.repair,
only_checks=check_arguments.only,
force=check_arguments.force,
)
borgmatic.hooks.command.execute_hook(
hooks.get('after_check'),
hooks.get('umask'),
config_filename,
'post-check',
global_arguments.dry_run,
**hook_context,
)

View File

@ -0,0 +1,65 @@
import logging
import borgmatic.borg.compact
import borgmatic.borg.feature
import borgmatic.config.validate
import borgmatic.hooks.command
logger = logging.getLogger(__name__)
def run_compact(
config_filename,
repository,
storage,
retention,
hooks,
hook_context,
local_borg_version,
compact_arguments,
global_arguments,
dry_run_label,
local_path,
remote_path,
):
'''
Run the "compact" action for the given repository.
'''
if compact_arguments.repository and not borgmatic.config.validate.repositories_match(
repository, compact_arguments.repository
):
return
borgmatic.hooks.command.execute_hook(
hooks.get('before_compact'),
hooks.get('umask'),
config_filename,
'pre-compact',
global_arguments.dry_run,
**hook_context,
)
if borgmatic.borg.feature.available(borgmatic.borg.feature.Feature.COMPACT, local_borg_version):
logger.info('{}: Compacting segments{}'.format(repository['path'], dry_run_label))
borgmatic.borg.compact.compact_segments(
global_arguments.dry_run,
repository['path'],
storage,
local_borg_version,
local_path=local_path,
remote_path=remote_path,
progress=compact_arguments.progress,
cleanup_commits=compact_arguments.cleanup_commits,
threshold=compact_arguments.threshold,
)
else: # pragma: nocover
logger.info(
'{}: Skipping compact (only available/needed in Borg 1.2+)'.format(repository['path'])
)
borgmatic.hooks.command.execute_hook(
hooks.get('after_compact'),
hooks.get('umask'),
config_filename,
'post-compact',
global_arguments.dry_run,
**hook_context,
)

View File

@ -0,0 +1,96 @@
import json
import logging
import borgmatic.borg.create
import borgmatic.config.validate
import borgmatic.hooks.command
import borgmatic.hooks.dispatch
import borgmatic.hooks.dump
logger = logging.getLogger(__name__)
def run_create(
config_filename,
repository,
location,
storage,
hooks,
hook_context,
local_borg_version,
create_arguments,
global_arguments,
dry_run_label,
local_path,
remote_path,
):
'''
Run the "create" action for the given repository.
If create_arguments.json is True, yield the JSON output from creating the archive.
'''
if create_arguments.repository and not borgmatic.config.validate.repositories_match(
repository, create_arguments.repository
):
return
borgmatic.hooks.command.execute_hook(
hooks.get('before_backup'),
hooks.get('umask'),
config_filename,
'pre-backup',
global_arguments.dry_run,
**hook_context,
)
logger.info('{}: Creating archive{}'.format(repository['path'], dry_run_label))
borgmatic.hooks.dispatch.call_hooks_even_if_unconfigured(
'remove_database_dumps',
hooks,
repository['path'],
borgmatic.hooks.dump.DATABASE_HOOK_NAMES,
location,
global_arguments.dry_run,
)
active_dumps = borgmatic.hooks.dispatch.call_hooks(
'dump_databases',
hooks,
repository['path'],
borgmatic.hooks.dump.DATABASE_HOOK_NAMES,
location,
global_arguments.dry_run,
)
stream_processes = [process for processes in active_dumps.values() for process in processes]
json_output = borgmatic.borg.create.create_archive(
global_arguments.dry_run,
repository['path'],
location,
storage,
local_borg_version,
local_path=local_path,
remote_path=remote_path,
progress=create_arguments.progress,
stats=create_arguments.stats,
json=create_arguments.json,
list_files=create_arguments.list_files,
stream_processes=stream_processes,
)
if json_output: # pragma: nocover
yield json.loads(json_output)
borgmatic.hooks.dispatch.call_hooks_even_if_unconfigured(
'remove_database_dumps',
hooks,
config_filename,
borgmatic.hooks.dump.DATABASE_HOOK_NAMES,
location,
global_arguments.dry_run,
)
borgmatic.hooks.command.execute_hook(
hooks.get('after_backup'),
hooks.get('umask'),
config_filename,
'post-backup',
global_arguments.dry_run,
**hook_context,
)

View File

@ -0,0 +1,48 @@
import logging
import borgmatic.borg.export_tar
import borgmatic.borg.rlist
import borgmatic.config.validate
logger = logging.getLogger(__name__)
def run_export_tar(
repository,
storage,
local_borg_version,
export_tar_arguments,
global_arguments,
local_path,
remote_path,
):
'''
Run the "export-tar" action for the given repository.
'''
if export_tar_arguments.repository is None or borgmatic.config.validate.repositories_match(
repository, export_tar_arguments.repository
):
logger.info(
f'{repository["path"]}: Exporting archive {export_tar_arguments.archive} as tar file'
)
borgmatic.borg.export_tar.export_tar_archive(
global_arguments.dry_run,
repository['path'],
borgmatic.borg.rlist.resolve_archive_name(
repository['path'],
export_tar_arguments.archive,
storage,
local_borg_version,
local_path,
remote_path,
),
export_tar_arguments.paths,
export_tar_arguments.destination,
storage,
local_borg_version,
local_path=local_path,
remote_path=remote_path,
tar_filter=export_tar_arguments.tar_filter,
list_files=export_tar_arguments.list_files,
strip_components=export_tar_arguments.strip_components,
)

View File

@ -0,0 +1,69 @@
import logging
import borgmatic.borg.extract
import borgmatic.borg.rlist
import borgmatic.config.validate
import borgmatic.hooks.command
logger = logging.getLogger(__name__)
def run_extract(
config_filename,
repository,
location,
storage,
hooks,
hook_context,
local_borg_version,
extract_arguments,
global_arguments,
local_path,
remote_path,
):
'''
Run the "extract" action for the given repository.
'''
borgmatic.hooks.command.execute_hook(
hooks.get('before_extract'),
hooks.get('umask'),
config_filename,
'pre-extract',
global_arguments.dry_run,
**hook_context,
)