Comments (3)
Hi,
you can run everywhere.
Best regards
from cv4pve-autosnap.
Hi, to achieve redundancy, this is what I'm doing:
Have a directory structure like this in any of the hosts:
/opt/tools/bin/cv4pve-autosnap (binary)
/opt/tools/etc/cron.d/cv4pve-autosnap (crontab file)
/opt/tools/scripts/cv4pve-autosnap.sh (shell script)
Link the crontab so the system cron can reach and execute
ln -s /opt/tools/etc/cron.d/cv4pve-autosnap /etc/cron.d/
Install syncthing on all hosts to keep /opt/tools synchronized automatically
(syncthing.net -> apt-get install syncthing, enable it and configure)
The script (/opt/tools/scripts/cv4pve-autosnap.sh):
#!/bin/bash
if [[ -z "$2" ]]; then
echo "Usage: $(basename $0) <label> <# keep> [all]"
exit 1
fi
snapshot_user="autosnap@pve"
snapshot_password="XXXXXXXXXXX"
label="$1"
keep="$2"
[[ -z "$3" ]] && what="all" || what="$3"
# Only run if this host is the cluster master
is_master=$(/usr/sbin/ha-manager status | grep -m 1 -o "^master $(hostname -s)")
if [[ ! -z "${is_master}" ]]; then
/opt/tools/bin/cv4pve-autosnap \
--host=127.0.0.1 \
--username=${snapshot_user} \
--password=${snapshot_password} \
--vmid="${what}" \
snap \
--label="${label}" \
--keep="${keep}" \
--only-running
fi
The cron file (/opt/tools/etc/cron.d/cv4pve-autosnap):
# Snapshot
0 0 * * * root /opt/tools/scripts/cv4pve-autosnap.sh daily 5 all
0 */1 * * * root /opt/tools/scripts/cv4pve-autosnap.sh hourly 8 all
This is far from the best way to do it probably, but it works for me :)
from cv4pve-autosnap.
You can run cv4pve-autosnap outside the cluster or in a vm or ct.
from cv4pve-autosnap.
Related Issues (20)
- POSSIBLE PROBLEM PERMISSION HOT 2
- Save snap to another storage HOT 2
- Same error trying to snap on proxmox 6.2 HOT 9
- Proxmox 7.2-11 issues HOT 3
- [FEATURE] Add an option to snapshot only running VMs/CTs HOT 4
- Feature: Snap from tags HOT 7
- Is it safety to use cv4pve-autosnap in conjunction with Storage Replication (pvecm)? HOT 7
- Obsolete defaults-extra-file HOT 1
- Object reference not set to an instance of an object. HOT 2
- Cannot exclude vm disks HOT 3
- Include an example of how to use a snapshot to restore a VM/CT ? HOT 1
- Can't snapshot a VM without disk HOT 4
- No usable version of libssl was found HOT 6
- API tokens syntax is an unlucky choice HOT 13
- Documentation unclear about exclusions in vmid parameter and missing other parameters HOT 15
- Feature: Option to disable Memory on snapshot HOT 1
- Incomplete error handling (or lack of filtering) for "non-snapshottable" machines HOT 1
- Destination storage HOT 2
- is promox 8 supported? HOT 1
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 cv4pve-autosnap.