Comments (11)
Cron working correctly using
PATH="/usr/local/bin:/usr/bin:/bin"
*/5 * * * * /usr/local/bin/autorestic -c /root/.autorestic.yml cron # Every 5 minutes
Closing :)
from autorestic.
Damn, then I need to look into it again. This is weird.
from autorestic.
Oh yes, of course, the docs are wrong, thanks for pointing that out!
from autorestic.
I just checked and even 0 * * * * /usr/local/bin/autorestic -c /srv/.autorestic.yml cron
actually does not work. 😔 No idea why. I need to fix that
from autorestic.
running /usr/local/bin/autorestic -c /srv/.autorestic.yml cron > /srv/cron.log 2>&1
tells me that restic is not installed. this is quite interesting.
from autorestic.
Is it previous bug of restic not getting auto installed and need manual installing?
Also I found I need to be on as root (or sudo), otherwise I get errors and it gets bit confused choosing between user and root.
I'll check tomorrow if cron jobs have run.
from autorestic.
I just found the issue, yes this was an issue before. I pretty sure this time I got the actual answer.
Basically: Cron does not run in a shell, so all the bin paths are not set and no bins are available as a command. So giving the absolute path for autorstic works, but then it cannot find the actual restic command.
Solution:
set path in the cron file
PATH="/usr/local/bin:/usr/bin:/bin"
0 4 * * 1 autorestic -c /srv/.autorestic.yml cron
now we don't even need to pass autorestic as a absolute path.
i will update the docs :)
from autorestic.
Please do let me know it this solves the issue for you :)
You can append a >> /some/log/file.log 2>&1
to check the output of the cron :)
from autorestic.
@jin-park-dev docs are updated https://cupcakearmy.github.io/autorestic/location/cron
from autorestic.
Awesome!
I change crontab with new info. I should find out if backups are happening on 3 machines.
from autorestic.
@jin-park-dev perfect :) If it works feel free to close the issue. Thanks for reporting!
from autorestic.
Related Issues (20)
- Suggestion: Validate location after executing before hooks HOT 2
- Docker volume backup not working from within container HOT 1
- `install` and `upgrade`: allow specifying destdir
- Info command prints out secret keys
- Hooks to have access to location path HOT 1
- Cron updates timestamp even when backup fails
- `uninstall` command is broken
- Docker compose example in the docker installation guide
- 'locations[storage]' has invalid keys: forgetoption HOT 4
- Keep up with restic releases HOT 1
- Restic repository not initialized by default in GCP
- Bug: Docker volume backup to B2 fails ("context deadline exceeded") HOT 1
- forget dryRun is always false on backup task
- Support backing up Docker volumes via the REST backend
- autorestic running backup.yml,restic print 'unknown flag: --use-fs-snapshot' HOT 1
- Copy a repo
- Add a cron option to the forget/prune policies
- Suggestion: don't require 'from' key in locations that use include arguments.
- $PATH being ignored by autorestic HOT 4
- Showing during the backup the progress in percentage of every single location
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autorestic.