Complete path in crontab is it ok? #445

Closed
opened 2021-09-03 20:37:35 +00:00 by jacobo · 3 comments

Thanks to develop borgmatic!

What I'm trying to do and why

Run via cron borgmatic

Actual behavior (if a bug)

Cronjob with complete path works but only borgmatic doesn't work

Complete path. it works:

00 22 * * * /usr/local/bin/borgmatic

Only command does not work:

00 22 * * * borgmatic

Expected behavior (if a bug)

I am curious about why it. Can you explain it to me, please?

Other notes / implementation ideas

Environment

borgmatic 1.5.13

borgmatic installation method:

via pip

Borg version: [version here]

borg 1.1.9

Python version: [version here]

Python 3.7.3

operating system and version: [OS here]

Debian Buster

Thanks to develop borgmatic! #### What I'm trying to do and why Run via cron borgmatic #### Actual behavior (if a bug) Cronjob with complete path works but only borgmatic doesn't work Complete path. it works: ``` 00 22 * * * /usr/local/bin/borgmatic ``` Only command does not work: ``` 00 22 * * * borgmatic ``` #### Expected behavior (if a bug) I am curious about why it. Can you explain it to me, please? #### Other notes / implementation ideas #### Environment borgmatic 1.5.13 **borgmatic installation method:** via pip **Borg version:** [version here] borg 1.1.9 **Python version:** [version here] Python 3.7.3 **operating system and version:** [OS here] Debian Buster
witten added the
question / support
label 2021-09-03 21:56:47 +00:00
Owner

Thanks for the question! What's going on here is that the borgmatic binary is installed in a location (/usr/local/bin/) that's not in your default PATH, the set of directories that are searched by default when you type a command. If you're running cron globally / system-wide, then it's running as the root user, and thus we're talking about the root user's PATH. Here are some instructions about modifying the PATH for borgmatic here: https://torsion.org/borgmatic/docs/how-to/set-up-backups/

And here is some general documentation about PATHs on Linux: https://www.computerhope.com/issues/ch001647.htm

Let me know if that helps!

Thanks for the question! What's going on here is that the borgmatic binary is installed in a location (`/usr/local/bin/`) that's not in your default `PATH`, the set of directories that are searched by default when you type a command. If you're running cron globally / system-wide, then it's running as the `root` user, and thus we're talking about the `root` user's `PATH`. Here are some instructions about modifying the `PATH` for borgmatic here: https://torsion.org/borgmatic/docs/how-to/set-up-backups/ And here is some general documentation about `PATH`s on Linux: https://www.computerhope.com/issues/ch001647.htm Let me know if that helps!
Author

Your explanation was very useful. Thank you :)

Your explanation was very useful. Thank you :)
Owner

Glad to hear it!

Glad to hear it!
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#445
No description provided.