[schnapps] Create numbered snapshots, so that .info files are kept
This commit is contained in:
parent
ae33428a3e
commit
1fa8b08c3b
1 changed files with 4 additions and 1 deletions
|
@ -6,7 +6,10 @@ HOST="maru"
|
||||||
|
|
||||||
create_snapshot () {
|
create_snapshot () {
|
||||||
logger -p user.info -t schnapps_backup "Creating schnapps backup for host ${HOST}"
|
logger -p user.info -t schnapps_backup "Creating schnapps backup for host ${HOST}"
|
||||||
if /usr/bin/schnapps upload > /dev/null;
|
/usr/bin/schnapps create -t time 'Pre-export snapshot'
|
||||||
|
sleep 1 # To make sure the lock is removed
|
||||||
|
snapshot_id=$(/usr/bin/schnapps list -j | /usr/bin/jq '.["snapshots"][-1].number')
|
||||||
|
if /usr/bin/schnapps upload "${snapshot_id}" > /dev/null;
|
||||||
then
|
then
|
||||||
logger -p user.info -t schnapps_backup "Snapshot for host ${HOST} created successfully"
|
logger -p user.info -t schnapps_backup "Snapshot for host ${HOST} created successfully"
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue