Missing description how to backup a single file #693

Closed
opened 2023-05-09 08:12:10 +00:00 by minh.do · 3 comments

What I'm trying to do and why

I am trying to backup a specific configuration file and not its parent directory.
I checked the configuration reference at https://torsion.org/borgmatic/docs/reference/configuration/ and I only found the location: source_directories. The name implies, that only directories are considered.
Knowing the structure of the syslogs I can only assume, that the source_directories configuration also applies to files? Or does it only work for files if used with globbing?

Other notes / implementation ideas

In case the statement does support files
an additional information for files would be helpful.

For example:

List of source directories and files to backup.

In the example globbing is used for the syslog files.
It might be easier for clarification if a single file and globbing is used like

# specific files can be backuped
- /var/log/auth.log
# globbed files can be backuped
- /var/log/syslog*

There is also the case of directory globbing with **. Since borgmatic is written in Python, I assume you can use ** to allow things like /home/**/.ssh?

#### What I'm trying to do and why I am trying to backup a specific configuration file and not its parent directory. I checked the configuration reference at https://torsion.org/borgmatic/docs/reference/configuration/ and I only found the `location: source_directories`. The name implies, that **only** directories are considered. Knowing the structure of the `syslog`s I can only assume, that the `source_directories` configuration also applies to files? Or does it only work for files if used with globbing? #### Other notes / implementation ideas In case the statement does support files an additional information for files would be helpful. For example: > List of source directories and files to backup. In the example globbing is used for the `syslog` files. It might be easier for clarification if a single file and globbing is used like ```yml # specific files can be backuped - /var/log/auth.log # globbed files can be backuped - /var/log/syslog* ``` There is also the case of directory globbing with `**`. Since `borgmatic` is written in Python, I assume you can use `**` to allow things like `/home/**/.ssh`?
witten added the
question / support
label 2023-05-09 17:10:01 +00:00
Owner

Yes, you can list individual files to backup in source_directories! Globs also work , including **.

I'll update the comment as you suggest. Let me know if you have any other questions!

Yes, you can list individual files to backup in `source_directories`! Globs also work ~~, including `**`~~. I'll update the comment as you suggest. Let me know if you have any other questions!
Owner

Actually, I just tried ** to match multiple levels of directories, and it doesn't appear to work for that.

Actually, I just tried `**` to match multiple levels of directories, and it _doesn't_ appear to work for that.
Author

Thanks for the additional comment!

Thanks for the additional comment!
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#693
No description provided.