-
Notifications
You must be signed in to change notification settings - Fork 22
/
script-hook.sh
executable file
·55 lines (45 loc) · 1.41 KB
/
script-hook.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#
# EnterpriseVE Backup And Restore Ceph for Proxmox VE hook script.
# Process environment variables as received from and set by eve4pve-barc.
hook() {
# echo "EVE4PVE_BARC_PHASE: $EVE4PVE_BARC_PHASE"
# echo "EVE4PVE_BARC_VMID: $EVE4PVE_BARC_VMID"
# echo "EVE4PVE_BARC_PATH: $EVE4PVE_BARC_PATH"
# echo "EVE4PVE_BARC_LABEL: $EVE4PVE_BARC_LABEL"
# echo "EVE4PVE_BARC_KEEP: $EVE4PVE_BARC_KEEP"
# echo "EVE4PVE_BARC_SNAP_NAME: $EVE4PVE_BARC_SNAP_NAME"
# echo "EVE4PVE_BARC_BACKUP_FILE: $EVE4PVE_BARC_BACKUP_FILE"
case "$EVE4PVE_BARC_PHASE" in
#clean job status
clean-job-start);;
clean-job-end);;
#backup job status
backup-job-start);;
backup-job-end);;
#create snapshot
snap-create-pre);;
snap-create-post);;
snap-create-abort);;
#export
export-pre);;
export-post);;
export-abort);;
#export diff
export-diff-pre);;
export-diff-post);;
export-diff-abort);;
#remove snapshot
snap-remove-pre);;
snap-remove-post);;
snap-remove-abort);;
#restore job status
restore-job-start);;
restore-job-end);;
#assemble job status
assemble-job-start);;
assemble-job-end);;
*) echo "unknown phase '$EVE4PVE_BARC_PHASE'"; return 1;;
esac
}
hook