Comments (5)
In the code where it had zfs I updated it with the full path which in my case was /sbin/zfs
and now it works in cron.
from zfs-prune-snapshots.
Seems to work for me as:
copied zfs-prune-snapshots
to /usr/bin
which zfs-prune-snapshots /usr/bin/zfs-prune-snapshots
added to sudo crontab -e
@daily /usr/bin/zfs-prune-snapshots -v 1s
from zfs-prune-snapshots.
Example directly from author's website:
11 0 * * * /opt/custom/bin/zfs-prune-snapshots -p automated_daily_ 7d >> /var/log/autosnap.log 2>&1
12 0 * * 0 /opt/custom/bin/zfs-prune-snapshots -p automated_weekly_ 4w >> /var/log/autosnap.log 2>&1
13 0 1 * * /opt/custom/bin/zfs-prune-snapshots -p automated_monthly_ 12M >> /var/log/autosnap.log 2>&1
14 0 1 1 * /opt/custom/bin/zfs-prune-snapshots -p automated_yearly_ 10y >> /var/log/autosnap.log 2>&1
from zfs-prune-snapshots.
The issue you are seeing is caused by your crontab not having a $PATH
environmental variable with zfs
in it. You can fix this in multiple ways, but it's outside the scope of this zfs-prune-snapshots
tool to handle managing your $PATH
variable. You can:
1
Specify the PATH in your cron line (if your cron supports it), ie:
0 0 * * * PATH=/bin:/sbin:/usr/bin:/usr/sbin:/whateveryouwant zfs-prune-snapshots ...
2
Have cron fire off a "helper" script whose job it is to call zfs-prune-snapshots
, ie:
0 0 * * * /path/to/my-helper-program
and my-helper-program
would look something like:
#!/bin/sh
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/whateveryouwant
exec zfs-prune-snapshots ...
3
Make sure cron is running/started with the proper PATH variable set.
from zfs-prune-snapshots.
Closing - feel free to reopen if I misunderstood the original issue and something is still broken.
from zfs-prune-snapshots.
Related Issues (10)
- Syntax error with space in pool name. HOT 5
- Thanks! HOT 5
- Feature request - dry-run HOT 3
- Error executing the script HOT 3
- Feature Request - Counter HOT 4
- Dealing with snapshots that have dependent clones HOT 1
- [Feature request] Protect last `x` number of snapshots HOT 5
- Add install procedure HOT 2
- time for a release? HOT 5
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 zfs-prune-snapshots.