From e1c2c89ebcf9fa197ffeeac908faa05b9f5ea60a Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Sun, 1 Sep 2024 10:59:17 -0400 Subject: [PATCH] Fixed gitignore for templates --- .gitignore | 2 + templates/excludes | 4 ++ templates/profiles.toml | 136 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 templates/excludes create mode 100644 templates/profiles.toml diff --git a/.gitignore b/.gitignore index bf181c4..8b714f3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ config/sysrescue/build_into_srm/root/* profiles.toml key excludes +!templates/* + diff --git a/templates/excludes b/templates/excludes new file mode 100644 index 0000000..f26427c --- /dev/null +++ b/templates/excludes @@ -0,0 +1,4 @@ +/var/log/journal +/var/log/*.gz +/var/log/*.bz2 +/var/log/*.xz diff --git a/templates/profiles.toml b/templates/profiles.toml new file mode 100644 index 0000000..88b0400 --- /dev/null +++ b/templates/profiles.toml @@ -0,0 +1,136 @@ +version = "1" + +[global] + # ionice is available on Linux only + ionice = false + ionice-class = 2 + ionice-level = 6 + # priority is using priority class on windows, and "nice" on unixes + priority = "low" + # run 'snapshots' when no command is specified when invoking resticprofile + default-command = "snapshots" + # initialize a repository if none exist at location + initialize = false + # resticprofile won't start a profile if there's less than 100MB of RAM available + min-memory = 100 + +# a group is a profile that will call all profiles one by one +[groups] + # when starting a backup on profile "full-backup", + # it will run the "system" backup profile + full-backup = [ "system" ] + +# Default profile when not specified on the command line (-n or --name) +# There's no default inheritance from the 'default' profile, +# you can use the 'inherit' flag if needed +[default] + # you can use a relative path, it will be relative to the configuration file + repository = "s3:http://mega.home.ld:9000/vm-backups/FIXME/" + #insecure-tls = true + password-file = "key" + initialize = false + # will run these scripts before and after each command (including 'backup') + #run-before = "mount /backup" + #run-after = "umount /backup" + # if a restic command fails, the run-after won't be running + # add this parameter to run the script in case of a failure + #run-after-fail = "umount /backup" + + # add environment variables + [default.env] + TMPDIR = "/tmp" + AWS_DEFAULT_REGION = "ca-east-1" + AWS_ACCESS_KEY_ID = "FIXME" + AWS_SECRET_ACCESS_KEY = "FIXME" + +# New profile named 'home' +[system] + inherit = "default" + initialize = false + # LOCAL lockfile so you cannot run the same profile more than once at a time + # (it's totally independent of the restic locks on the repository) + #lock = "/tmp/resticprofile-home.lock" + + # 'backup' command of profile 'home' + [system.backup] + # files with no path are relative to the configuration file + exclude-file = [ "excludes" ] + exclude-if-present = [ ".nobackup" ] + exclude-caches = true + one-file-system = false + tag = [ "system" ] + source = [ + "/root", + "/etc", + "/var/log", + "/usr/local", + "/var/spool/cron", + "/var/backups", + "/srv", + "/opt" + ] + # ignore restic warnings when files cannot be read + no-error-on-warning = true + # run every day at midnight + schedule = "03:00" + schedule-permission = "system" + schedule-lock-wait = "2h" + # System Scripts + run-before = [ + "/etc/resticprofile/scripts/os before" + ] + # Copy to Borgbase: + run-after = [ + "/etc/resticprofile/scripts/os after", + "resticprofile system.copy" + ] + # On Failure: + run-fail = [ + "/etc/resticprofile/scripts/os fail" + ] + # Clean up: + run-finally = [ + "/etc/resticprofile/scripts/os final" + ] + + lock = "/tmp/resticprofile-system.backup.lock" + + # retention policy for profile home + # retention is a special section that run the "forget" command + # before or after a backup + [system.retention] + before-backup = false + after-backup = true + keep-hourly = 2 + keep-daily = 14 + keep-weekly = 26 + keep-monthly = 12 + keep-within = "3h" + keep-tag = [ "forever" ] + prune = false + # tag can be a boolean ('true' meaning to copy tag set from 'backup') + # or a custom set of tags. + # Default is 'false', meaning that tags are NOT used. + tag = true + # host can be a boolean ('true' meaning current hostname) + # or a string to specify a different hostname + host = true + + [system.prune] + schedule = "Sun 05:00" + schedule-permission = "system" + schedule-lock-wait = "2h" + + [system.copy] + after-backup = true + initialize = true + initialize-copy-chunker-params = true + repository = "rest:https://FIXME.repo.borgbase.com" + password-file = "key" + lock = "/tmp/resticprofile-system.copy.lock" + +[borgbase] + #inherit = "home" + inherit = "default" + initialize = false + repository = "rest:https://FIXME.repo.borgbase.com"