Can't set path on Pi 4B. #317

Closed
opened 2020-05-19 15:11:43 +00:00 by verax-satya · 19 comments

What I'm trying to do and why

I'm trying to set the path for borg, and sadly, all of the different methods I've tried haven't worked. I've tried to reset the path on both ~/.profile and ~/.bashrc and even after rebooting and running the 'source' command, it isn't working.

Steps to reproduce (if a bug)

Raspberry Pi 4b on OpenMediaVault 5. I essentially followed all of the directions to install borg, along with borgmatic. Added the following at the end of ~/.profile and ~/.bashrc.

export PATH="$PATH:/root/.local/bin"

Expected behavior (if a bug)

Whenever I try to execute the following

sudo generate-borgmatic-config

I just get back

sudo: generate-borgmatic-config: command not found

Other notes / implementation ideas

I should note that if I put in the following as root

export PATH="$PATH:/root/.local/bin"

It works for that session, but I would like something more solid. Once I log out of root, it also stops working.

Environment

borgmatic version: [1.5.4]

borgmatic installation method: [Debian package]

Borg version: [1.1.11]

Python version: [3.7.3]

operating system and version: [Open Media Vault 5, Debian]

#### What I'm trying to do and why I'm trying to set the path for borg, and sadly, all of the different methods I've tried haven't worked. I've tried to reset the path on both ~/.profile and ~/.bashrc and even after rebooting and running the 'source' command, it isn't working. #### Steps to reproduce (if a bug) Raspberry Pi 4b on OpenMediaVault 5. I essentially followed all of the directions to install borg, along with borgmatic. Added the following at the end of ~/.profile and ~/.bashrc. ``` export PATH="$PATH:/root/.local/bin" ``` #### Expected behavior (if a bug) Whenever I try to execute the following ``` sudo generate-borgmatic-config ``` I just get back ``` sudo: generate-borgmatic-config: command not found ``` #### Other notes / implementation ideas I should note that if I put in the following as root ``` export PATH="$PATH:/root/.local/bin" ``` It works for that session, but I would like something more solid. Once I log out of root, it also stops working. #### Environment **borgmatic version:** [1.5.4] **borgmatic installation method:** [Debian package] **Borg version:** [1.1.11] **Python version:** [3.7.3] **operating system and version:** [Open Media Vault 5, Debian]
Owner

Thanks for filing this! There are few things more frustrating than system path issues..

One thing you didn't mention: Are you adding the path extention to the end of root's ~/.profile and ~/.bashrc, or your non-root user's? I believe that if you want to be able to run borgmatic commands with sudo, you'll need to do this for your non-root user's ~/.profile / ~/.bashrc. If you haven't tried that already, please give that a shot. You might also try your ~/.bash_profile if that's not already sourcing ~/.bashrc.

Thanks for filing this! There are few things more frustrating than system path issues.. One thing you didn't mention: Are you adding the path extention to the end of root's `~/.profile` and `~/.bashrc`, or your non-root user's? I believe that if you want to be able to run borgmatic commands with sudo, you'll need to do this for your non-root user's `~/.profile` / `~/.bashrc`. If you haven't tried that already, please give that a shot. You might also try your `~/.bash_profile` if that's not already sourcing `~/.bashrc`.
witten added the
question / support
label 2020-05-19 17:22:00 +00:00
Author

Not a problem! Thank you, haha, it is my first foray into the subject and a very interesting one to say the least.

Apologies on that end. I have added into my root user's ~/.profile and ~/.bashrc, along with my non-root user's. I've also made it so that my ~/.bash_profile is sourcing ~/.bashrc

Do you have any suggestions on what else I should try? Most of the things I've looked up show that these processes should work on Debian. Very odd!

Not a problem! Thank you, haha, it is my first foray into the subject and a very interesting one to say the least. Apologies on that end. I have added into my root user's `~/.profile` and `~/.bashrc`, along with my non-root user's. I've also made it so that my `~/.bash_profile` is sourcing `~/.bashrc` Do you have any suggestions on what else I should try? Most of the things I've looked up show that these processes should work on Debian. Very odd!
Owner

Couple of ideas for other things to try:

  1. After logging in, type echo $PATH and see whether /root/.local/bin is present in your PATH. If it is, then you know that's not the problem! A related approach is to add an echo hi statement or similar to ~/.bashrc to see if hi shows up when you login.
  2. Are you sure that borgmatic is successfully installed in /root/.local/bin? Does running the full path via /root/.local/bin/generate-borgmatic-config work?

I assume that you're using Bash and not another shell?

Couple of ideas for other things to try: 1. After logging in, type `echo $PATH` and see whether `/root/.local/bin` is present in your `PATH`. If it is, then you know that's not the problem! A related approach is to add an `echo hi` statement or similar to `~/.bashrc` to see if `hi` shows up when you login. 2. Are you sure that borgmatic is successfully installed in `/root/.local/bin`? Does running the full path via `/root/.local/bin/generate-borgmatic-config` work? I assume that you're using Bash and not another shell?
Author

These returned very interesting results, thank you!

After running echo $PATH, I get these results, which does show that /root/.local/bin is in the path, isn't that correct?

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:~/.local/bin:~/.local/bin:~/.local/bin:~/.local/bin:/root/.local/bin:/root/.local/bin:/root/.local/bin:/root/.local/bin:/root/.local/bin:/root/.local/bin:/root/.local/bin

Additionally, adding echo hi does show up when I run source ~/.bashrc afterwards.

I am quite sure that it is installed in /root/.local/bin, because if I run the full path, it does end up working! I did run this command with sudo in front of it. Of course, since I already have a config file, it spits out the following. Sadly it still doesn't recognize commands with sudo, weird.

/etc/borgmatic/config.yaml already exists. Aborting.
These returned very interesting results, thank you! After running echo $PATH, I get these results, which does show that /root/.local/bin is in the path, isn't that correct? ``` /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:~/.local/bin:~/.local/bin:~/.local/bin:~/.local/bin:/root/.local/bin:/root/.local/bin:/root/.local/bin:/root/.local/bin:/root/.local/bin:/root/.local/bin:/root/.local/bin ``` Additionally, adding `echo hi` does show up when I run `source ~/.bashrc` afterwards. I am quite sure that it is installed in /root/.local/bin, because if I run the full path, it does end up working! I did run this command with sudo in front of it. Of course, since I already have a config file, it spits out the following. Sadly it still doesn't recognize commands with sudo, weird. ``` /etc/borgmatic/config.yaml already exists. Aborting. ```
Owner

And that PATH you pasted is for the root user or the non-root user? For sudo generate-borgmatic-config to work, I believe the non-root user will need /root/.local/bin in their path.

The only other thing I can think of is a permissions issue, e.g. the non-root user not being able to access /root or /root/.local/bin or both. However I would expect that to manifest as a different error.

If you still can't get this working, then another option would be to: Uninstall borgmatic (pip3 uninstall borgmatic as root), and then reinstall borgmatic without the --user flag. That would install borgmatic globally at the system level, and would hopefully bypass all of the PATH issues as it would be on the default path.

The main downside of this approach is that its installation would be a little less self-contained / separated from the rest of the system.

And that `PATH` you pasted is for the root user or the non-root user? For `sudo generate-borgmatic-config` to work, I believe the non-root user will need `/root/.local/bin` in their path. The only other thing I can think of is a permissions issue, e.g. the non-root user not being able to access `/root` or `/root/.local/bin` or both. However I would expect that to manifest as a different error. If you still can't get this working, then another option would be to: Uninstall borgmatic (`pip3 uninstall borgmatic` as root), and then reinstall borgmatic *without* the `--user` flag. That would install borgmatic globally at the system level, and would hopefully bypass all of the PATH issues as it would be on the default path. The main downside of this approach is that its installation would be a little less self-contained / separated from the rest of the system.
Author

The path listed was for the non-root user!

Non-Root

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:~/.local/bin:~/.local/bin:~/.local/bin:~/.local/bin:/root/.local/bin

Root

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin

Do you think there is anything else I should look into with the possible permissions issue? If not, I'll go ahead and try to reinstall globally! Should I try to reinstall as root as well?

The path listed was for the non-root user! Non-Root ``` /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:~/.local/bin:~/.local/bin:~/.local/bin:~/.local/bin:/root/.local/bin ``` Root ``` /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin ``` Do you think there is anything else I should look into with the possible permissions issue? If not, I'll go ahead and try to reinstall globally! Should I try to reinstall as root as well?
Owner

At this point I'd recommend just reinstalling globally, assuming you're okay with that. Given that this is probably a relatively dedicated device (a Pi), that's probably fine. The --user install recommendation is mostly there for workstations or big servers where you want to keep things relatively segregated, so installs of different Python software don't conflict with one another.

At this point I'd recommend just reinstalling globally, assuming you're okay with that. Given that this is probably a relatively dedicated device (a Pi), that's probably fine. The `--user` install recommendation is mostly there for workstations or big servers where you want to keep things relatively segregated, so installs of different Python software don't conflict with one another.
Author

That worked great! In a bit, I'll be running a backup and can report back on what transpires. So far, sudo validate-borgmatic-config along with sudo generate-borgmatic-config are working flawlessly.

That worked great! In a bit, I'll be running a backup and can report back on what transpires. So far, `sudo validate-borgmatic-config` along with `sudo generate-borgmatic-config` are working flawlessly.
Owner

Awesome, so glad to hear it! I'll update the instructions to mention the global install as an option.

Awesome, so glad to hear it! I'll update the instructions to mention the global install as an option.
Author

So, after trying to run a backup with sudo borgmatic --verbosity 1 --files, I have gotten these error lines back. Do you know what the issue is and how I could solve it? I'd be happy to make another ticket for this if this is unrelated.

Exception ignored in: <function Repository.__del__ at 0xb59f4ae0>
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 179, in __del__
    self.close()
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 446, in close
    self.lock.release()
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 383, in release
    self._roster.modify(EXCLUSIVE, REMOVE)
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 286, in modify
    self.save(roster)
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 257, in save
    with open(self.path, "w") as f:
OSError: [Errno 30] Read-only file system: '/srv/dev-disk-by-label-backup_drive/Borg_Backup/lock.roster'
Local Exception
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 166, in wrapper
/srv/dev-disk-by-label-backup_drive/Borg_Backup: Error running actions for repository
Command 'borg create --list --filter AME- --info /srv/dev-disk-by-label-backup_drive/Borg_Backup::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /srv/dev-disk-by-label-main_drive/' returned non-zero exit status 2.
/etc/borgmatic/config.yaml: Error running configuration file

summary:
/etc/borgmatic/config.yaml: Error running configuration file
/srv/dev-disk-by-label-backup_drive/Borg_Backup: Error running actions for repository
...
A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25530/64-64-crop.png
A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25530/256-256-crop.png
A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25530/125-256.png
A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25530/256-526.png
A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25534/1415-464-max.jpg
A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25534/464-464-crop.jpg
A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25534/64-64-crop.jpg
A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25534/256-256-crop.jpg
A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25534/781-256.jpg
Exception ignored in: <function Repository.__del__ at 0xb59f4ae0>
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 179, in __del__
    self.close()
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 446, in close
    self.lock.release()
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 383, in release
    self._roster.modify(EXCLUSIVE, REMOVE)
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 286, in modify
    self.save(roster)
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 257, in save
    with open(self.path, "w") as f:
OSError: [Errno 30] Read-only file system: '/srv/dev-disk-by-label-backup_drive/Borg_Backup/lock.roster'
Local Exception
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 166, in wrapper
Command 'borg create --list --filter AME- --info /srv/dev-disk-by-label-backup_drive/Borg_Backup::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /srv/dev-disk-by-label-main_drive/' returned non-zero exit status 2.

Need some help? https://torsion.org/borgmatic/#issues

I've listed my config.yaml below. For some reason it didn't let me upload it.

# Where to look for files to backup, and where to store those backups. See
# https://borgbackup.readthedocs.io/en/stable/quickstart.html and
# https://borgbackup.readthedocs.io/en/stable/usage.html#borg-create for details.
location:
    # List of source directories to backup (required). Globs and tildes are expanded.
    source_directories:
        - /srv/dev-disk-by-label-main_drive/

    # Paths to local or remote repositories (required). Tildes are expanded. Multiple
    # repositories are backed up to in sequence. See ssh_command for SSH options like
    # identity file or port.
    repositories:
        - /srv/dev-disk-by-label-backup_drive/Borg_Backup

    # Stay in same file system (do not cross mount points). Defaults to false.
    # one_file_system: true

    # Only store/extract numeric user and group identifiers. Defaults to false.
    # numeric_owner: true

    # Store atime into archive. Defaults to true.
    # atime: false

    # Store ctime into archive. Defaults to true.
    # ctime: false

    # Store birthtime (creation date) into archive. Defaults to true.
    # birthtime: false

    # Use Borg's --read-special flag to allow backup of block and other special
    # devices. Use with caution, as it will lead to problems if used when
    # backing up special devices such as /dev/zero. Defaults to false.
    # read_special: false

    # Record bsdflags (e.g. NODUMP, IMMUTABLE) in archive. Defaults to true.
    # bsd_flags: true

    # Mode in which to operate the files cache. See
    # https://borgbackup.readthedocs.io/en/stable/usage/create.html#description for
    # details. Defaults to "ctime,size,inode".
    # files_cache: ctime,size,inode

    # Alternate Borg local executable. Defaults to "borg".
    # local_path: borg1

    # Alternate Borg remote executable. Defaults to "borg".
    # remote_path: borg1

    # Any paths matching these patterns are included/excluded from backups. Globs are
    # expanded. (Tildes are not.) Note that Borg considers this option experimental.
    # See the output of "borg help patterns" for more details. Quote any value if it
    # contains leading punctuation, so it parses correctly.
    # patterns:
        # - R /
        # - '- /home/*/.cache'
        # - + /home/susan
        # - '- /home/*'

    # Read include/exclude patterns from one or more separate named files, one pattern
    # per line. Note that Borg considers this option experimental. See the output of
    # "borg help patterns" for more details.
    # patterns_from:
        # - /etc/borgmatic/patterns

    # Any paths matching these patterns are excluded from backups. Globs and tildes
    # are expanded. See the output of "borg help patterns" for more details.
    # exclude_patterns:
        # - '*.pyc'
        # - ~/*/.cache
        # - /etc/ssl

    # Read exclude patterns from one or more separate named files, one pattern per
    # line. See the output of "borg help patterns" for more details.
    # exclude_from:
        # - /etc/borgmatic/excludes

    # Exclude directories that contain a CACHEDIR.TAG file. See
    # http://www.brynosaurus.com/cachedir/spec.html for details. Defaults to false.
    # exclude_caches: true

    # Exclude directories that contain a file with the given filenames. Defaults to not
    # set.
    # exclude_if_present:
        # - .nobackup

    # If true, the exclude_if_present filename is included in backups. Defaults to
    # false, meaning that the exclude_if_present filename is omitted from backups.
    # keep_exclude_tags: true

    # Exclude files with the NODUMP flag. Defaults to false.
    # exclude_nodump: true

    # Path for additional source files used for temporary internal state like
    # borgmatic database dumps. Note that changing this path prevents "borgmatic
    # restore" from finding any database dumps created before the change. Defaults
    # to ~/.borgmatic
    # borgmatic_source_directory: /tmp/borgmatic

# Repository storage options. See
# https://borgbackup.readthedocs.io/en/stable/usage.html#borg-create and
# https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables for
# details.
# storage:
    # The standard output of this command is used to unlock the encryption key. Only
    # use on repositories that were initialized with passcommand/repokey encryption.
    # Note that if both encryption_passcommand and encryption_passphrase are set,
    # then encryption_passphrase takes precedence. Defaults to not set.
    # encryption_passcommand: secret-tool lookup borg-repository repo-name

    # Passphrase to unlock the encryption key with. Only use on repositories that were
    # initialized with passphrase/repokey encryption. Quote the value if it contains
    # punctuation, so it parses correctly. And backslash any quote or backslash
    # literals as well. Defaults to not set.
    # encryption_passphrase: "Password"

    # Number of seconds between each checkpoint during a long-running backup. See
    # https://borgbackup.readthedocs.io/en/stable/faq.html#if-a-backup-stops-mid-way-does-the-already-backed-up-data-stay-there
    # for details. Defaults to checkpoints every 1800 seconds (30 minutes).
    # checkpoint_interval: 1800
 
    # Specify the parameters passed to then chunker (CHUNK_MIN_EXP, CHUNK_MAX_EXP,
    # HASH_MASK_BITS, HASH_WINDOW_SIZE). See https://borgbackup.readthedocs.io/en/stable/internals.html
    # for details. Defaults to "19,23,21,4095".
    # chunker_params: 19,23,21,4095/srv/dev-disk-by-label-main_drive

    # Type of compression to use when creating archives. See
    # https://borgbackup.readthedocs.org/en/stable/usage.html#borg-create for details.
    # Defaults to "lz4".
    # compression: none

    # Remote network upload rate limit in kiBytes/second. Defaults to unlimited.
    # remote_rate_limit: 100

    # Command to use instead of "ssh". This can be used to specify ssh options.
    # Defaults to not set.
    # ssh_command: ssh -i /path/to/private/key

    # Base path used for various Borg directories. Defaults to $HOME, ~$USER, or ~.
    # See https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables for details.
    # borg_base_directory: /path/to/base

    # Path for Borg configuration files. Defaults to $borg_base_directory/.config/borg
    # borg_config_directory: /path/to/base/config

    # Path for Borg cache files. Defaults to $borg_base_directory/.cache/borg
    # borg_cache_directory: /path/to/base/cache

    # Path for Borg security and encryption nonce files. Defaults to $borg_base_directory/.config/borg/security
    # borg_security_directory: /path/to/base/config/security

    # Path for Borg encryption key files. Defaults to $borg_base_directory/.config/borg/keys
    # borg_keys_directory: /path/to/base/config/keys

    # Umask to be used for borg create. Defaults to 0077.
    # umask: 0077

    # Maximum seconds to wait for acquiring a repository/cache lock. Defaults to 1.
    # lock_wait: 5

    # Name of the archive. Borg placeholders can be used. See the output of
    # "borg help placeholders" for details. Defaults to
    # "{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}". If you specify this option, you must
    # also specify a prefix in the retention section to avoid accidental pruning of
    # archives with a different archive name format. And you should also specify a
    # prefix in the consistency section as well.
    # archive_name_format: '{hostname}-documents-{now}'

    # Bypass Borg error about a repository that has been moved. Defaults to false.
    # relocated_repo_access_is_ok: true

    # Bypass Borg error about a previously unknown unencrypted repository. Defaults to
    # false.
    # unknown_unencrypted_repo_access_is_ok: true

    # Additional options to pass directly to particular Borg commands, handy for Borg
    # options that borgmatic does not yet support natively. Note that borgmatic does
    # not perform any validation on these options. Running borgmatic with
    # "--verbosity 2" shows the exact Borg command-line invocation.
    # extra_borg_options:
        # Extra command-line options to pass to "borg init".
        # init: --make-parent-dirs

        # Extra command-line options to pass to "borg prune".
        # prune: --save-space

        # Extra command-line options to pass to "borg create".
        # create: --no-files-cache

        # Extra command-line options to pass to "borg check".
        # check: --save-space

# Retention policy for how many backups to keep in each category. See
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-prune for details.
# At least one of the "keep" options is required for pruning to work. See
# https://torsion.org/borgmatic/docs/how-to/deal-with-very-large-backups/
# if you'd like to skip pruning entirely.
retention:
    # Keep all archives within this time interval.
    # keep_within: 3H

    # Number of secondly archives to keep.
    # keep_secondly: 60

    # Number of minutely archives to keep.
    # keep_minutely: 60

    # Number of hourly archives to keep.
    # keep_hourly: 24

    # Number of daily archives to keep.
    keep_daily: 7

    # Number of weekly archives to keep.
    # keep_weekly: 4

    # Number of monthly archives to keep.
    # keep_monthly: 6

    # Number of yearly archives to keep.
    # keep_yearly: 1

    # When pruning, only consider archive names starting with this prefix.
    # Borg placeholders can be used. See the output of "borg help placeholders" for
    # details. Defaults to "{hostname}-". Use an empty value to disable the default.
    # prefix: sourcehostname

# Consistency checks to run after backups. See
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-check and
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-extract for details.
# consistency:
    # List of one or more consistency checks to run: "repository", "archives", "data",
    # and/or "extract". Defaults to "repository" and "archives". Set to "disabled" to
    # disable all consistency checks. "repository" checks the consistency of the
    # repository, "archives" checks all of the archives, "data" verifies the integrity
    # of the data within the archives, and "extract" does an extraction dry-run of the
    # most recent archive. Note that "data" implies "archives".
    # checks:
        # - repository
        # - archives
    # Paths to a subset of the repositories in the location section on which to run
    # consistency checks. Handy in case some of your repositories are very large, and
    # so running consistency checks on them would take too long. Defaults to running
    # consistency checks on all repositories configured in the location section.
    # check_repositories:
        # - user@backupserver:sourcehostname.borg

    # Restrict the number of checked archives to the last n. Applies only to the "archives" check. Defaults to checking all archives.
    # check_last: 3

    # When performing the "archives" check, only consider archive names starting with
    # this prefix. Borg placeholders can be used. See the output of
    # "borg help placeholders" for details. Defaults to "{hostname}-". Use an empty
    # value to disable the default.
    # prefix: sourcehostname

# Options for customizing borgmatic's own output and logging.
# output:
    # Apply color to console output. Can be overridden with --no-color command-line
    # flag. Defaults to true.
    # color: false

# Shell commands, scripts, or integrations to execute at various points during a borgmatic
# run. IMPORTANT: All provided commands and scripts are executed with user permissions of
# borgmatic. Do not forget to set secure permissions on this configuration file (chmod
# 0600) as well as on any script called from a hook (chmod 0700) to prevent potential
# shell injection or privilege escalation.
# hooks:
    # List of one or more shell commands or scripts to execute before creating a
    # backup, run once per configuration file.
    # before_backup:
        # - echo "Starting a backup."

    # List of one or more shell commands or scripts to execute before pruning, run
    # once per configuration file.
    # before_prune:
        # - echo "Starting pruning."

    # List of one or more shell commands or scripts to execute before consistency
    # checks, run once per configuration file.
    # before_check:
        # - echo "Starting checks."

    # List of one or more shell commands or scripts to execute after creating a
    # backup, run once per configuration file.
    # after_backup:
        # - echo "Finished a backup."

    # List of one or more shell commands or scripts to execute after pruning, run once
    # per configuration file.
    # after_prune:
        # - echo "Finished pruning."

    # List of one or more shell commands or scripts to execute after consistency
    # checks, run once per configuration file.
    # after_check:
        # - echo "Finished checks."

    # List of one or more shell commands or scripts to execute when an exception
    # occurs during a "prune", "create", or "check" action or an associated
    # before/after hook.
    # on_error:
        # - echo "Error during prune/create/check."

    # List of one or more PostgreSQL databases to dump before creating a backup,
    # run once per configuration file. The database dumps are added to your source
    # directories at runtime, backed up, and then removed afterwards. Requires
    # pg_dump/pg_dumpall/pg_restore commands. See
    # https://www.postgresql.org/docs/current/app-pgdump.html for details.
    # postgresql_databases:
          # Database name (required if using this hook). Or "all" to dump all
          # databases on the host.
        # - name: users

          # Database hostname to connect to. Defaults to connecting via local
          # Unix socket.
          # hostname: database.example.org

          # Port to connect to. Defaults to 5432
          # port: 5433

          # Username with which to connect to the database. Defaults to the
          # username of the current user. You probably want to specify the
          # "postgres" superuser here when the database name is "all".
          # username: dbuser

          # Password with which to connect to the database. Omitting a password
          # will only work if PostgreSQL is configured to trust the configured
          # username without a password, or you create a ~/.pgpass file.
          # password: trustsome1

          # Database dump output format. One of "plain", "custom", "directory",
          # or "tar". Defaults to "custom" (unlike raw pg_dump). See
          # https://www.postgresql.org/docs/current/app-pgdump.html for details.
          # Note that format is ignored when the database name is "all".
          # format: directory

          # Additional pg_dump/pg_dumpall options to pass directly to the dump
          # command, without performing any validation on them. See
          # https://www.postgresql.org/docs/current/app-pgdump.html for details.
          # options: --role=someone

    # List of one or more MySQL/MariaDB databases to dump before creating a backup,
    # run once per configuration file. The database dumps are added to your source
    # directories at runtime, backed up, and then removed afterwards. Requires
    # mysqldump/mysql commands (from either MySQL or MariaDB). See
    # https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html or
    # https://mariadb.com/kb/en/library/mysqldump/ for details.
    # mysql_databases:
          # Database name (required if using this hook). Or "all" to dump all
          # databases on the host.
        # - name: users

          # Database hostname to connect to. Defaults to connecting via local
          # Unix socket.
          # hostname: database.example.org

          # Port to connect to. Defaults to 3306.
          # port: 3307

          # Username with which to connect to the database. Defaults to the
          # username of the current user.
          # username: dbuser

          # Password with which to connect to the database. Omitting a password
          # will only work if MySQL is configured to trust the configured
          # username without a password.
          # password: trustsome1

          # Additional mysqldump options to pass directly to the dump command,
          # without performing any validation on them. See
          # https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html or
          # https://mariadb.com/kb/en/library/mysqldump/ for details.
          # options: --skip-comments

    # Healthchecks ping URL or UUID to notify when a backup begins, ends, or errors.
    # Create an account at https://healthchecks.io if you'd like to use this service.
    # See
    # https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/#healthchecks-hook
    # for details.
    # healthchecks: https://hc-ping.com/your-uuid-here

    # Cronitor ping URL to notify when a backup begins, ends, or errors. Create an
    # account at https://cronitor.io if you'd like to use this service. See
    # https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/#cronitor-hook
    # for details.
    # cronitor: https://cronitor.link/d3x0c1

    # PagerDuty integration key used to notify PagerDuty when a backup errors. Create
    # an account at https://www.pagerduty.com/ if you'd like to use this service. See
    # https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/#pagerduty-hook
    # for details.
    # pagerduty: a177cad45bd374409f78906a810a3074

    # Cronhub ping URL to notify when a backup begins, ends, or errors. Create an
    # account at https://cronhub.io if you'd like to use this service. See
    # https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/#cronhub-hook for
    # details.
    # cronhub: https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031

    # List of one or more shell commands or scripts to execute before running all
    # actions (if one of them is "create"). These are collected from all configuration
    # files and then run once before all of them (prior to all actions).
    # before_everything:
        # - echo "Starting actions."

    # List of one or more shell commands or scripts to execute after running all
    # actions (if one of them is "create"). These are collected from all configuration
    # files and then run once before all of them (prior to all actions).
    # after_everything:
        # - echo "Completed actions."

    # Umask used when executing hooks. Defaults to the umask that borgmatic is run with.
    # umask: 0077
So, after trying to run a backup with `sudo borgmatic --verbosity 1 --files`, I have gotten these error lines back. Do you know what the issue is and how I could solve it? I'd be happy to make another ticket for this if this is unrelated. ``` Exception ignored in: <function Repository.__del__ at 0xb59f4ae0> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/borg/repository.py", line 179, in __del__ self.close() File "/usr/lib/python3/dist-packages/borg/repository.py", line 446, in close self.lock.release() File "/usr/lib/python3/dist-packages/borg/locking.py", line 383, in release self._roster.modify(EXCLUSIVE, REMOVE) File "/usr/lib/python3/dist-packages/borg/locking.py", line 286, in modify self.save(roster) File "/usr/lib/python3/dist-packages/borg/locking.py", line 257, in save with open(self.path, "w") as f: OSError: [Errno 30] Read-only file system: '/srv/dev-disk-by-label-backup_drive/Borg_Backup/lock.roster' Local Exception Traceback (most recent call last): File "/usr/lib/python3/dist-packages/borg/archiver.py", line 166, in wrapper /srv/dev-disk-by-label-backup_drive/Borg_Backup: Error running actions for repository Command 'borg create --list --filter AME- --info /srv/dev-disk-by-label-backup_drive/Borg_Backup::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /srv/dev-disk-by-label-main_drive/' returned non-zero exit status 2. /etc/borgmatic/config.yaml: Error running configuration file summary: /etc/borgmatic/config.yaml: Error running configuration file /srv/dev-disk-by-label-backup_drive/Borg_Backup: Error running actions for repository ... A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25530/64-64-crop.png A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25530/256-256-crop.png A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25530/125-256.png A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25530/256-526.png A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25534/1415-464-max.jpg A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25534/464-464-crop.jpg A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25534/64-64-crop.jpg A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25534/256-256-crop.jpg A /srv/dev-disk-by-label-main_drive/appdata/ncdata/nextcloud/data/appdata_ocg4r4ehpgxp/preview/25534/781-256.jpg Exception ignored in: <function Repository.__del__ at 0xb59f4ae0> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/borg/repository.py", line 179, in __del__ self.close() File "/usr/lib/python3/dist-packages/borg/repository.py", line 446, in close self.lock.release() File "/usr/lib/python3/dist-packages/borg/locking.py", line 383, in release self._roster.modify(EXCLUSIVE, REMOVE) File "/usr/lib/python3/dist-packages/borg/locking.py", line 286, in modify self.save(roster) File "/usr/lib/python3/dist-packages/borg/locking.py", line 257, in save with open(self.path, "w") as f: OSError: [Errno 30] Read-only file system: '/srv/dev-disk-by-label-backup_drive/Borg_Backup/lock.roster' Local Exception Traceback (most recent call last): File "/usr/lib/python3/dist-packages/borg/archiver.py", line 166, in wrapper Command 'borg create --list --filter AME- --info /srv/dev-disk-by-label-backup_drive/Borg_Backup::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /srv/dev-disk-by-label-main_drive/' returned non-zero exit status 2. Need some help? https://torsion.org/borgmatic/#issues ``` **I've listed my config.yaml below. For some reason it didn't let me upload it.** ``` # Where to look for files to backup, and where to store those backups. See # https://borgbackup.readthedocs.io/en/stable/quickstart.html and # https://borgbackup.readthedocs.io/en/stable/usage.html#borg-create for details. location: # List of source directories to backup (required). Globs and tildes are expanded. source_directories: - /srv/dev-disk-by-label-main_drive/ # Paths to local or remote repositories (required). Tildes are expanded. Multiple # repositories are backed up to in sequence. See ssh_command for SSH options like # identity file or port. repositories: - /srv/dev-disk-by-label-backup_drive/Borg_Backup # Stay in same file system (do not cross mount points). Defaults to false. # one_file_system: true # Only store/extract numeric user and group identifiers. Defaults to false. # numeric_owner: true # Store atime into archive. Defaults to true. # atime: false # Store ctime into archive. Defaults to true. # ctime: false # Store birthtime (creation date) into archive. Defaults to true. # birthtime: false # Use Borg's --read-special flag to allow backup of block and other special # devices. Use with caution, as it will lead to problems if used when # backing up special devices such as /dev/zero. Defaults to false. # read_special: false # Record bsdflags (e.g. NODUMP, IMMUTABLE) in archive. Defaults to true. # bsd_flags: true # Mode in which to operate the files cache. See # https://borgbackup.readthedocs.io/en/stable/usage/create.html#description for # details. Defaults to "ctime,size,inode". # files_cache: ctime,size,inode # Alternate Borg local executable. Defaults to "borg". # local_path: borg1 # Alternate Borg remote executable. Defaults to "borg". # remote_path: borg1 # Any paths matching these patterns are included/excluded from backups. Globs are # expanded. (Tildes are not.) Note that Borg considers this option experimental. # See the output of "borg help patterns" for more details. Quote any value if it # contains leading punctuation, so it parses correctly. # patterns: # - R / # - '- /home/*/.cache' # - + /home/susan # - '- /home/*' # Read include/exclude patterns from one or more separate named files, one pattern # per line. Note that Borg considers this option experimental. See the output of # "borg help patterns" for more details. # patterns_from: # - /etc/borgmatic/patterns # Any paths matching these patterns are excluded from backups. Globs and tildes # are expanded. See the output of "borg help patterns" for more details. # exclude_patterns: # - '*.pyc' # - ~/*/.cache # - /etc/ssl # Read exclude patterns from one or more separate named files, one pattern per # line. See the output of "borg help patterns" for more details. # exclude_from: # - /etc/borgmatic/excludes # Exclude directories that contain a CACHEDIR.TAG file. See # http://www.brynosaurus.com/cachedir/spec.html for details. Defaults to false. # exclude_caches: true # Exclude directories that contain a file with the given filenames. Defaults to not # set. # exclude_if_present: # - .nobackup # If true, the exclude_if_present filename is included in backups. Defaults to # false, meaning that the exclude_if_present filename is omitted from backups. # keep_exclude_tags: true # Exclude files with the NODUMP flag. Defaults to false. # exclude_nodump: true # Path for additional source files used for temporary internal state like # borgmatic database dumps. Note that changing this path prevents "borgmatic # restore" from finding any database dumps created before the change. Defaults # to ~/.borgmatic # borgmatic_source_directory: /tmp/borgmatic # Repository storage options. See # https://borgbackup.readthedocs.io/en/stable/usage.html#borg-create and # https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables for # details. # storage: # The standard output of this command is used to unlock the encryption key. Only # use on repositories that were initialized with passcommand/repokey encryption. # Note that if both encryption_passcommand and encryption_passphrase are set, # then encryption_passphrase takes precedence. Defaults to not set. # encryption_passcommand: secret-tool lookup borg-repository repo-name # Passphrase to unlock the encryption key with. Only use on repositories that were # initialized with passphrase/repokey encryption. Quote the value if it contains # punctuation, so it parses correctly. And backslash any quote or backslash # literals as well. Defaults to not set. # encryption_passphrase: "Password" # Number of seconds between each checkpoint during a long-running backup. See # https://borgbackup.readthedocs.io/en/stable/faq.html#if-a-backup-stops-mid-way-does-the-already-backed-up-data-stay-there # for details. Defaults to checkpoints every 1800 seconds (30 minutes). # checkpoint_interval: 1800 # Specify the parameters passed to then chunker (CHUNK_MIN_EXP, CHUNK_MAX_EXP, # HASH_MASK_BITS, HASH_WINDOW_SIZE). See https://borgbackup.readthedocs.io/en/stable/internals.html # for details. Defaults to "19,23,21,4095". # chunker_params: 19,23,21,4095/srv/dev-disk-by-label-main_drive # Type of compression to use when creating archives. See # https://borgbackup.readthedocs.org/en/stable/usage.html#borg-create for details. # Defaults to "lz4". # compression: none # Remote network upload rate limit in kiBytes/second. Defaults to unlimited. # remote_rate_limit: 100 # Command to use instead of "ssh". This can be used to specify ssh options. # Defaults to not set. # ssh_command: ssh -i /path/to/private/key # Base path used for various Borg directories. Defaults to $HOME, ~$USER, or ~. # See https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables for details. # borg_base_directory: /path/to/base # Path for Borg configuration files. Defaults to $borg_base_directory/.config/borg # borg_config_directory: /path/to/base/config # Path for Borg cache files. Defaults to $borg_base_directory/.cache/borg # borg_cache_directory: /path/to/base/cache # Path for Borg security and encryption nonce files. Defaults to $borg_base_directory/.config/borg/security # borg_security_directory: /path/to/base/config/security # Path for Borg encryption key files. Defaults to $borg_base_directory/.config/borg/keys # borg_keys_directory: /path/to/base/config/keys # Umask to be used for borg create. Defaults to 0077. # umask: 0077 # Maximum seconds to wait for acquiring a repository/cache lock. Defaults to 1. # lock_wait: 5 # Name of the archive. Borg placeholders can be used. See the output of # "borg help placeholders" for details. Defaults to # "{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}". If you specify this option, you must # also specify a prefix in the retention section to avoid accidental pruning of # archives with a different archive name format. And you should also specify a # prefix in the consistency section as well. # archive_name_format: '{hostname}-documents-{now}' # Bypass Borg error about a repository that has been moved. Defaults to false. # relocated_repo_access_is_ok: true # Bypass Borg error about a previously unknown unencrypted repository. Defaults to # false. # unknown_unencrypted_repo_access_is_ok: true # Additional options to pass directly to particular Borg commands, handy for Borg # options that borgmatic does not yet support natively. Note that borgmatic does # not perform any validation on these options. Running borgmatic with # "--verbosity 2" shows the exact Borg command-line invocation. # extra_borg_options: # Extra command-line options to pass to "borg init". # init: --make-parent-dirs # Extra command-line options to pass to "borg prune". # prune: --save-space # Extra command-line options to pass to "borg create". # create: --no-files-cache # Extra command-line options to pass to "borg check". # check: --save-space # Retention policy for how many backups to keep in each category. See # https://borgbackup.readthedocs.org/en/stable/usage.html#borg-prune for details. # At least one of the "keep" options is required for pruning to work. See # https://torsion.org/borgmatic/docs/how-to/deal-with-very-large-backups/ # if you'd like to skip pruning entirely. retention: # Keep all archives within this time interval. # keep_within: 3H # Number of secondly archives to keep. # keep_secondly: 60 # Number of minutely archives to keep. # keep_minutely: 60 # Number of hourly archives to keep. # keep_hourly: 24 # Number of daily archives to keep. keep_daily: 7 # Number of weekly archives to keep. # keep_weekly: 4 # Number of monthly archives to keep. # keep_monthly: 6 # Number of yearly archives to keep. # keep_yearly: 1 # When pruning, only consider archive names starting with this prefix. # Borg placeholders can be used. See the output of "borg help placeholders" for # details. Defaults to "{hostname}-". Use an empty value to disable the default. # prefix: sourcehostname # Consistency checks to run after backups. See # https://borgbackup.readthedocs.org/en/stable/usage.html#borg-check and # https://borgbackup.readthedocs.org/en/stable/usage.html#borg-extract for details. # consistency: # List of one or more consistency checks to run: "repository", "archives", "data", # and/or "extract". Defaults to "repository" and "archives". Set to "disabled" to # disable all consistency checks. "repository" checks the consistency of the # repository, "archives" checks all of the archives, "data" verifies the integrity # of the data within the archives, and "extract" does an extraction dry-run of the # most recent archive. Note that "data" implies "archives". # checks: # - repository # - archives # Paths to a subset of the repositories in the location section on which to run # consistency checks. Handy in case some of your repositories are very large, and # so running consistency checks on them would take too long. Defaults to running # consistency checks on all repositories configured in the location section. # check_repositories: # - user@backupserver:sourcehostname.borg # Restrict the number of checked archives to the last n. Applies only to the "archives" check. Defaults to checking all archives. # check_last: 3 # When performing the "archives" check, only consider archive names starting with # this prefix. Borg placeholders can be used. See the output of # "borg help placeholders" for details. Defaults to "{hostname}-". Use an empty # value to disable the default. # prefix: sourcehostname # Options for customizing borgmatic's own output and logging. # output: # Apply color to console output. Can be overridden with --no-color command-line # flag. Defaults to true. # color: false # Shell commands, scripts, or integrations to execute at various points during a borgmatic # run. IMPORTANT: All provided commands and scripts are executed with user permissions of # borgmatic. Do not forget to set secure permissions on this configuration file (chmod # 0600) as well as on any script called from a hook (chmod 0700) to prevent potential # shell injection or privilege escalation. # hooks: # List of one or more shell commands or scripts to execute before creating a # backup, run once per configuration file. # before_backup: # - echo "Starting a backup." # List of one or more shell commands or scripts to execute before pruning, run # once per configuration file. # before_prune: # - echo "Starting pruning." # List of one or more shell commands or scripts to execute before consistency # checks, run once per configuration file. # before_check: # - echo "Starting checks." # List of one or more shell commands or scripts to execute after creating a # backup, run once per configuration file. # after_backup: # - echo "Finished a backup." # List of one or more shell commands or scripts to execute after pruning, run once # per configuration file. # after_prune: # - echo "Finished pruning." # List of one or more shell commands or scripts to execute after consistency # checks, run once per configuration file. # after_check: # - echo "Finished checks." # List of one or more shell commands or scripts to execute when an exception # occurs during a "prune", "create", or "check" action or an associated # before/after hook. # on_error: # - echo "Error during prune/create/check." # List of one or more PostgreSQL databases to dump before creating a backup, # run once per configuration file. The database dumps are added to your source # directories at runtime, backed up, and then removed afterwards. Requires # pg_dump/pg_dumpall/pg_restore commands. See # https://www.postgresql.org/docs/current/app-pgdump.html for details. # postgresql_databases: # Database name (required if using this hook). Or "all" to dump all # databases on the host. # - name: users # Database hostname to connect to. Defaults to connecting via local # Unix socket. # hostname: database.example.org # Port to connect to. Defaults to 5432 # port: 5433 # Username with which to connect to the database. Defaults to the # username of the current user. You probably want to specify the # "postgres" superuser here when the database name is "all". # username: dbuser # Password with which to connect to the database. Omitting a password # will only work if PostgreSQL is configured to trust the configured # username without a password, or you create a ~/.pgpass file. # password: trustsome1 # Database dump output format. One of "plain", "custom", "directory", # or "tar". Defaults to "custom" (unlike raw pg_dump). See # https://www.postgresql.org/docs/current/app-pgdump.html for details. # Note that format is ignored when the database name is "all". # format: directory # Additional pg_dump/pg_dumpall options to pass directly to the dump # command, without performing any validation on them. See # https://www.postgresql.org/docs/current/app-pgdump.html for details. # options: --role=someone # List of one or more MySQL/MariaDB databases to dump before creating a backup, # run once per configuration file. The database dumps are added to your source # directories at runtime, backed up, and then removed afterwards. Requires # mysqldump/mysql commands (from either MySQL or MariaDB). See # https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html or # https://mariadb.com/kb/en/library/mysqldump/ for details. # mysql_databases: # Database name (required if using this hook). Or "all" to dump all # databases on the host. # - name: users # Database hostname to connect to. Defaults to connecting via local # Unix socket. # hostname: database.example.org # Port to connect to. Defaults to 3306. # port: 3307 # Username with which to connect to the database. Defaults to the # username of the current user. # username: dbuser # Password with which to connect to the database. Omitting a password # will only work if MySQL is configured to trust the configured # username without a password. # password: trustsome1 # Additional mysqldump options to pass directly to the dump command, # without performing any validation on them. See # https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html or # https://mariadb.com/kb/en/library/mysqldump/ for details. # options: --skip-comments # Healthchecks ping URL or UUID to notify when a backup begins, ends, or errors. # Create an account at https://healthchecks.io if you'd like to use this service. # See # https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/#healthchecks-hook # for details. # healthchecks: https://hc-ping.com/your-uuid-here # Cronitor ping URL to notify when a backup begins, ends, or errors. Create an # account at https://cronitor.io if you'd like to use this service. See # https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/#cronitor-hook # for details. # cronitor: https://cronitor.link/d3x0c1 # PagerDuty integration key used to notify PagerDuty when a backup errors. Create # an account at https://www.pagerduty.com/ if you'd like to use this service. See # https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/#pagerduty-hook # for details. # pagerduty: a177cad45bd374409f78906a810a3074 # Cronhub ping URL to notify when a backup begins, ends, or errors. Create an # account at https://cronhub.io if you'd like to use this service. See # https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/#cronhub-hook for # details. # cronhub: https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031 # List of one or more shell commands or scripts to execute before running all # actions (if one of them is "create"). These are collected from all configuration # files and then run once before all of them (prior to all actions). # before_everything: # - echo "Starting actions." # List of one or more shell commands or scripts to execute after running all # actions (if one of them is "create"). These are collected from all configuration # files and then run once before all of them (prior to all actions). # after_everything: # - echo "Completed actions." # Umask used when executing hooks. Defaults to the umask that borgmatic is run with. # umask: 0077 ```
Owner

That appears to be an error coming directly from Borg, saying that the repository path you've specified is on a read-only filesystem.. meaning that Borg doesn't have the ability to write to your backup destination.

So can you check that Borg has the ability to write to /srv/dev-disk-by-label-backup_drive/Borg_Backup/lock.roster? You can even just verify that manually at the command-line by using your editor of choice to create and save a text file somewhere in /srv/dev-disk-by-label-backup_drive/Borg_Backup.

That appears to be an error coming directly from Borg, saying that the repository path you've specified is on a read-only filesystem.. meaning that Borg doesn't have the ability to write to your backup destination. So can you check that Borg has the ability to write to `/srv/dev-disk-by-label-backup_drive/Borg_Backup/lock.roster`? You can even just verify that manually at the command-line by using your editor of choice to create and save a text file somewhere in `/srv/dev-disk-by-label-backup_drive/Borg_Backup`.
Author

Yes, you are spot on with that. Thank you. I was able to solve this permissions issue by putting in sudo chmod ug+rwx /srv/dev-disk-by-label-backup_drive and can now create a new file in 'Borg_Backup'

Sadly however, as one problem is solved another does tend to appear, haha. I'm getting this new error, can you shed some light onto it? Essentially I intend to backup around 250GB from one hard drive to another for redundancy. The hard drive that is the repository 'backup_drive', is completely empty. It seems to be showing an error that it doesn't have enough space?

summary:
/etc/borgmatic/config.yaml: Error running configuration file
/srv/dev-disk-by-label-backup_drive/Borg_Backup: Error running actions for repository
...
  [Previous line repeated 2 more times]
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 625, in _process
    status = archive.process_file(path, st, cache)
  File "/usr/lib/python3/dist-packages/borg/archive.py", line 1071, in process_file
    self.chunk_file(item, cache, self.stats, backup_io_iter(self.chunker.chunkify(fd, fh)))
  File "/usr/lib/python3/dist-packages/borg/archive.py", line 999, in chunk_file
    item.chunks.append(chunk_processor(data))
  File "/usr/lib/python3/dist-packages/borg/archive.py", line 987, in chunk_processor
    chunk_entry = cache.add_chunk(self.key.id_hash(data), data, stats, wait=False)
  File "/usr/lib/python3/dist-packages/borg/cache.py", line 899, in add_chunk
    self.repository.put(id, data, wait=wait)
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 1131, in put
    segment, offset = self.io.write_put(id, data)
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 1537, in write_put
    fd.write(b''.join((crc, header, id, data)))
  File "/usr/lib/python3/dist-packages/borg/platform/base.py", line 116, in write
    self.fd.write(data)
OSError: [Errno 28] No space left on device
Platform: Linux Pi-4 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l
Linux: debian 10.4
Borg: 1.1.11  Python: CPython 3.7.3 msgpack: 0.5.6
PID: 32514  CWD: /home/pi
sys.argv: ['/usr/bin/borg', 'create', '--debug', '--show-rc', '/srv/dev-disk-by-label-backup_drive/Borg_Backup::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}', '/srv/dev-disk-by-label-main_drive/']
SSH_ORIGINAL_COMMAND: None
terminating with error status, rc 2
Command 'borg create --debug --show-rc /srv/dev-disk-by-label-backup_drive/Borg_Backup::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /srv/dev-disk-by-label-main_drive/' returned non-zero exit status 2.

Need some help? https://torsion.org/borgmatic/#issues
Yes, you are spot on with that. Thank you. I was able to solve this permissions issue by putting in `sudo chmod ug+rwx /srv/dev-disk-by-label-backup_drive` and can now create a new file in 'Borg_Backup' Sadly however, as one problem is solved another does tend to appear, haha. I'm getting this new error, can you shed some light onto it? Essentially I intend to backup around 250GB from one hard drive to another for redundancy. The hard drive that is the repository 'backup_drive', is completely empty. It seems to be showing an error that it doesn't have enough space? ``` summary: /etc/borgmatic/config.yaml: Error running configuration file /srv/dev-disk-by-label-backup_drive/Borg_Backup: Error running actions for repository ... [Previous line repeated 2 more times] File "/usr/lib/python3/dist-packages/borg/archiver.py", line 625, in _process status = archive.process_file(path, st, cache) File "/usr/lib/python3/dist-packages/borg/archive.py", line 1071, in process_file self.chunk_file(item, cache, self.stats, backup_io_iter(self.chunker.chunkify(fd, fh))) File "/usr/lib/python3/dist-packages/borg/archive.py", line 999, in chunk_file item.chunks.append(chunk_processor(data)) File "/usr/lib/python3/dist-packages/borg/archive.py", line 987, in chunk_processor chunk_entry = cache.add_chunk(self.key.id_hash(data), data, stats, wait=False) File "/usr/lib/python3/dist-packages/borg/cache.py", line 899, in add_chunk self.repository.put(id, data, wait=wait) File "/usr/lib/python3/dist-packages/borg/repository.py", line 1131, in put segment, offset = self.io.write_put(id, data) File "/usr/lib/python3/dist-packages/borg/repository.py", line 1537, in write_put fd.write(b''.join((crc, header, id, data))) File "/usr/lib/python3/dist-packages/borg/platform/base.py", line 116, in write self.fd.write(data) OSError: [Errno 28] No space left on device Platform: Linux Pi-4 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l Linux: debian 10.4 Borg: 1.1.11 Python: CPython 3.7.3 msgpack: 0.5.6 PID: 32514 CWD: /home/pi sys.argv: ['/usr/bin/borg', 'create', '--debug', '--show-rc', '/srv/dev-disk-by-label-backup_drive/Borg_Backup::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}', '/srv/dev-disk-by-label-main_drive/'] SSH_ORIGINAL_COMMAND: None terminating with error status, rc 2 Command 'borg create --debug --show-rc /srv/dev-disk-by-label-backup_drive/Borg_Backup::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /srv/dev-disk-by-label-main_drive/' returned non-zero exit status 2. Need some help? https://torsion.org/borgmatic/#issues ```
Owner

My recommendation is to run a command like sudo df -h to show you the disk usage of the various disks in your system. That prints out a table showing the used, available, and percentage for each device. It should give you an idea of whether your disk is indeed full or close to it!

My recommendation is to run a command like `sudo df -h` to show you the disk usage of the various disks in your system. That prints out a table showing the used, available, and percentage for each device. It should give you an idea of whether your disk is indeed full or close to it!
Author

Oh interesting, so, it spit this out. I checked OMV and it turns out that my 'backup_drive' was not mounted. I wonder why it just put the repository into the root partition instead?

Filesystem      Size  Used Avail Use% Mounted on
/dev/root        29G   26G  2.1G  93% /
devtmpfs        1.8G     0  1.8G   0% /dev
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           2.0G  9.8M  1.9G   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           2.0G   12K  2.0G   1% /tmp
/dev/mmcblk0p1  253M   53M  200M  21% /boot
folder2ram      2.0G   28M  1.9G   2% /var/log
folder2ram      2.0G     0  2.0G   0% /var/tmp
folder2ram      2.0G  268K  2.0G   1% /var/lib/openmediavault/rrd
folder2ram      2.0G  740K  2.0G   1% /var/spool
folder2ram      2.0G   12M  1.9G   1% /var/lib/rrdcached
folder2ram      2.0G  4.0K  2.0G   1% /var/lib/monit
folder2ram      2.0G  7.4M  2.0G   1% /var/cache/samba
/dev/sdb1       916G  231G  686G  26% /srv/dev-disk-by-label-main_drive
overlay          29G   26G  2.1G  93% /var/lib/docker/overlay2/fd4d2673984479104c79746a623619d0ff28dfd010a67f251f97b73d0d48a013/merged
overlay          29G   26G  2.1G  93% /var/lib/docker/overlay2/f6dfb2258946103c79c23b47ea24b826677ac256fd0d3d13bb3e4833f885d1d8/merged
tmpfs           391M     0  391M   0% /run/user/1000
/dev/sda1       916G  114M  916G   1% /srv/dev-disk-by-label-backup_drive

How would you go about pruning the partial repo that somehow ended up on /dev/root?

Additionally, when I go to start a backup, it asks for my passphrase although I've specified it in the config.yaml. Do I have an issue with how I input that?

Oh interesting, so, it spit this out. I checked OMV and it turns out that my 'backup_drive' was not mounted. I wonder why it just put the repository into the root partition instead? ``` Filesystem Size Used Avail Use% Mounted on /dev/root 29G 26G 2.1G 93% / devtmpfs 1.8G 0 1.8G 0% /dev tmpfs 2.0G 0 2.0G 0% /dev/shm tmpfs 2.0G 9.8M 1.9G 1% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup tmpfs 2.0G 12K 2.0G 1% /tmp /dev/mmcblk0p1 253M 53M 200M 21% /boot folder2ram 2.0G 28M 1.9G 2% /var/log folder2ram 2.0G 0 2.0G 0% /var/tmp folder2ram 2.0G 268K 2.0G 1% /var/lib/openmediavault/rrd folder2ram 2.0G 740K 2.0G 1% /var/spool folder2ram 2.0G 12M 1.9G 1% /var/lib/rrdcached folder2ram 2.0G 4.0K 2.0G 1% /var/lib/monit folder2ram 2.0G 7.4M 2.0G 1% /var/cache/samba /dev/sdb1 916G 231G 686G 26% /srv/dev-disk-by-label-main_drive overlay 29G 26G 2.1G 93% /var/lib/docker/overlay2/fd4d2673984479104c79746a623619d0ff28dfd010a67f251f97b73d0d48a013/merged overlay 29G 26G 2.1G 93% /var/lib/docker/overlay2/f6dfb2258946103c79c23b47ea24b826677ac256fd0d3d13bb3e4833f885d1d8/merged tmpfs 391M 0 391M 0% /run/user/1000 /dev/sda1 916G 114M 916G 1% /srv/dev-disk-by-label-backup_drive ``` How would you go about pruning the partial repo that somehow ended up on /dev/root? Additionally, when I go to start a backup, it asks for my passphrase although I've specified it in the config.yaml. Do I have an issue with how I input that?
Owner

I wonder why it just put the repository into the root partition instead?

I believe that's just how Linux works.. Any path that's not otherwise mounted is presumed to be on the root partition.

How would you go about pruning the partial repo that somehow ended up on /dev/root?

I would just delete the whole contents of the Borg_Backup/ directory before mounting, assuming that you don't mind recreating / re-initing it after you mount the directory.

Additionally, when I go to start a backup, it asks for my passphrase although I've specified it in the config.yaml. Do I have an issue with how I input that?

Not sure about that one. Make sure it's uncommented in the configuration file?

> I wonder why it just put the repository into the root partition instead? I believe that's just how Linux works.. Any path that's not otherwise mounted is presumed to be on the root partition. > How would you go about pruning the partial repo that somehow ended up on /dev/root? I would just delete the whole contents of the `Borg_Backup/` directory before mounting, assuming that you don't mind recreating / re-`init`ing it after you mount the directory. > Additionally, when I go to start a backup, it asks for my passphrase although I've specified it in the config.yaml. Do I have an issue with how I input that? Not sure about that one. Make sure it's uncommented in the configuration file?
Author

I would just delete the whole contents of the Borg_Backup/ directory before mounting, assuming that you don't mind recreating / re-initing it after you mount the directory.

I went along with deleting that folder, however, on my SD Card, it still showed as entirely full until I went ahead and wiped the drive. Weird. Thank you!

Not sure about that one. Make sure it's uncommented in the configuration file?

How does this look? Is that correct?

# storage:
    # The standard output of this command is used to unlock the encryption key. Only
    # use on repositories that were initialized with passcommand/repokey encryption.
    # Note that if both encryption_passcommand and encryption_passphrase are set,
    # then encryption_passphrase takes precedence. Defaults to not set.
    # encryption_passcommand: secret-tool lookup borg-repository repo-name

    # Passphrase to unlock the encryption key with. Only use on repositories that were
    # initialized with passphrase/repokey encryption. Quote the value if it contains
    # punctuation, so it parses correctly. And backslash any quote or backslash
    # literals as well. Defaults to not set.
    # encryption_passphrase: "Password"
> I would just delete the whole contents of the Borg_Backup/ directory before mounting, assuming that you don't mind recreating / re-initing it after you mount the directory. I went along with deleting that folder, however, on my SD Card, it still showed as entirely full until I went ahead and wiped the drive. Weird. Thank you! > Not sure about that one. Make sure it's uncommented in the configuration file? How does this look? Is that correct? ``` # storage: # The standard output of this command is used to unlock the encryption key. Only # use on repositories that were initialized with passcommand/repokey encryption. # Note that if both encryption_passcommand and encryption_passphrase are set, # then encryption_passphrase takes precedence. Defaults to not set. # encryption_passcommand: secret-tool lookup borg-repository repo-name # Passphrase to unlock the encryption key with. Only use on repositories that were # initialized with passphrase/repokey encryption. Quote the value if it contains # punctuation, so it parses correctly. And backslash any quote or backslash # literals as well. Defaults to not set. # encryption_passphrase: "Password" ```
Owner

Glad to hear the free space issue sounds like it's sorted out.

As for the passphrase, it's still commented out! Try this:

storage:
    # The standard output of this command is used to unlock the encryption key. Only
    # use on repositories that were initialized with passcommand/repokey encryption.
    # Note that if both encryption_passcommand and encryption_passphrase are set,
    # then encryption_passphrase takes precedence. Defaults to not set.
    # encryption_passcommand: secret-tool lookup borg-repository repo-name

    # Passphrase to unlock the encryption key with. Only use on repositories that were
    # initialized with passphrase/repokey encryption. Quote the value if it contains
    # punctuation, so it parses correctly. And backslash any quote or backslash
    # literals as well. Defaults to not set.
    encryption_passphrase: "Password"

Note the removed # before both the storage: and the encryption_passphrase.

Glad to hear the free space issue sounds like it's sorted out. As for the passphrase, it's still commented out! Try this: ```yaml storage: # The standard output of this command is used to unlock the encryption key. Only # use on repositories that were initialized with passcommand/repokey encryption. # Note that if both encryption_passcommand and encryption_passphrase are set, # then encryption_passphrase takes precedence. Defaults to not set. # encryption_passcommand: secret-tool lookup borg-repository repo-name # Passphrase to unlock the encryption key with. Only use on repositories that were # initialized with passphrase/repokey encryption. Quote the value if it contains # punctuation, so it parses correctly. And backslash any quote or backslash # literals as well. Defaults to not set. encryption_passphrase: "Password" ``` Note the removed `#` before both the `storage:` and the `encryption_passphrase`.
Author

I see! Thank you. I just tried that out and everything seems to have run to perfection. Working on setting up the cron script now. Thank you so much for your help and patience with this, it is greatly appreciated!

I see! Thank you. I just tried that out and everything seems to have run to perfection. Working on setting up the cron script now. Thank you so much for your help and patience with this, it is greatly appreciated!
Owner

Glad to hear it's working!

Glad to hear it's working!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#317
No description provided.