[Errno 2] No such file or directory: 'borg' #114

Closed
opened 2018-12-02 07:19:35 +00:00 by breyer · 6 comments

I've been struggling for a few days with the following error message when i start borgmatic via cron.

"[Errno 2] No such file or directory: 'borg'"

I can't figure out where the error is coming from. If I start borgmatic without cron, i don't get an error message.

I also use borgmatic on another server with the same configuration. Since the error does not occur there, i would assume that the problem has to do with the backup job.

Is there a way to narrow this down further?

Thank you
Mark

I've been struggling for a few days with the following error message when i start borgmatic via cron. "[Errno 2] No such file or directory: 'borg'" I can't figure out where the error is coming from. If I start borgmatic without cron, i don't get an error message. I also use borgmatic on another server with the same configuration. Since the error does not occur there, i would assume that the problem has to do with the backup job. Is there a way to narrow this down further? Thank you Mark
Owner

Hi Mark,

I'm guessing that this problem is due to cron running by default without setting the PATH, or perhaps with an incorrect path, meaning that the Borg binary can't be found. My recommendation is to modify your borgmatic invocation via cron to include the appropriate system PATH, thereby allowing borgmatic to find Borg. Here's an example: https://projects.torsion.org/witten/borgmatic/src/branch/master/sample/cron/borgmatic

Your particular Borg binary location may be different than /usr/local/bin though. You can find it by running: which borg

Let me know if that works!

Hi Mark, I'm guessing that this problem is due to cron running by default without setting the PATH, or perhaps with an incorrect path, meaning that the Borg binary can't be found. My recommendation is to modify your borgmatic invocation via cron to include the appropriate system PATH, thereby allowing borgmatic to find Borg. Here's an example: https://projects.torsion.org/witten/borgmatic/src/branch/master/sample/cron/borgmatic Your particular Borg binary location may be different than `/usr/local/bin` though. You can find it by running: `which borg` Let me know if that works!
witten added the
question / support
label 2018-12-02 22:48:29 +00:00
Author

bull's eye! The working server knowns the path to borg, the other not.
Thank you for your hint!

bull's eye! The working server knowns the path to borg, the other not. Thank you for your hint!
Owner

Cool, glad to hear that worked out!

Cool, glad to hear that worked out!
breyer reopened this issue 2018-12-02 22:53:13 +00:00
Author

Ahhrg. Sorry, tested this on the wrong server.
My problem server also knowns the path to the borg binary. But i will try your hint with the path variable in the cron job. I'll come back to you.

Ahhrg. Sorry, tested this on the wrong server. My problem server also knowns the path to the borg binary. But i will try your hint with the path variable in the cron job. I'll come back to you.
Author

Your mentioned hint with the PATH in the cronjob fixed my issue.
And again something learned.

Your mentioned hint with the PATH in the cronjob fixed my issue. And again something learned.
Owner

Great!

Great!
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#114
No description provided.