Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
franklupo committed Mar 29, 2019
1 parent 71ed9ba commit dcc10fd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ Commands:
Options:
--vmid The ID of the VM/CT, comma separated (es. 100,101,102),
'all-???' for all known guest systems in specific host (es. all-pve1, all-$(hostname)),
'all' for all known guest systems in cluster
'all' for all known guest systems in cluster,
'storage-???' storage Proxmox VE (pool Ceph)
--label Is usually 'hourly', 'daily', 'weekly', or 'monthly'
--path Path destination backup
--keep Specify the number of backup which should will keep, Default 1
--script Use specified hook script
Es. /usr/share/doc/eve4pve-barc/examples/script-hook.sh
E.g. /usr/share/doc/eve4pve-barc/examples/script-hook.sh
--syslog Write messages into the system log
--mail Email addresses send log backup, comma separated (es. info@domain.ltd,info1@domain.ltd)
--unprotect-snap Disable protection snapshot, default is protected.
In Proxmox VE 'protected snapshot' cause problem in remove VM/CT see documentation.
Report bugs to <support@enterpriseve.com>.
Report bugs to <support@enterpriseve.com>
```

## Introduction
Expand Down
8 changes: 7 additions & 1 deletion changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
eve4pve-barc (0.1.9)
eve4pve-barc (0.2.0)

* Improve code

-- EnterpriseVE Support Team <support@enterpriseve.com> 29 Mar 2019 11:50:01 +0100

eve4pve-barc (0.1.9)

* Add support backup VM in storage Proxmox VE (pool Ceph)
* Improve log debug
Expand Down
32 changes: 16 additions & 16 deletions eve4pve-barc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# EnterpriseVE Backup And Restore Ceph for Proxmox VE.
# Author: Daniele Corsini <daniele.corsini@enterpriseve.com>

declare -r VERSION=0.1.9
declare -r VERSION=0.2.0
declare -r NAME=$(basename "$0")
declare -r PROGNAME=${NAME%.*}

Expand Down Expand Up @@ -100,13 +100,13 @@ Options:
--path Path destination backup
--keep Specify the number of backup which should will keep, Default 1
--script Use specified hook script
Es. /usr/share/doc/$PROGNAME/examples/script-hook.sh
E.g. /usr/share/doc/$PROGNAME/examples/script-hook.sh
--syslog Write messages into the system log
--mail Email addresses send log backup, comma separated (es. info@domain.ltd,info1@domain.ltd)
--unprotect-snap Disable protection snapshot, default is protected.
In Proxmox VE 'protected snapshot' cause problem in remove VM/CT see documentation.
Report bugs to <support@enterpriseve.com>.
Report bugs to <support@enterpriseve.com>
EOF

exit 1
Expand Down Expand Up @@ -203,6 +203,18 @@ function parse_opts(){
esac
done

if [ $opt_debug -eq 1 ]; then
log info "============================================"
log info "EnterpriseVE BARC Version: $VERSION";
log info "============================================"
log info "Proxmox VE Version:"

#info proxmox
pveversion --verbose

log info "============================================"
fi

if [ "$action" != "reset" ]; then
[ ! -d "$opt_path_backup" ] && { log info "Path Backup is not set"; end_process 1; }
fi
Expand Down Expand Up @@ -237,7 +249,7 @@ function parse_opts(){
local storage=${opt_vm_ids#*-}

if ! pvesm list "$storage" > /dev/null 2>&1; then
log info "Pool '$storage' not found in ProxmoxVE storage."
log info "Pool '$storage' not found in Proxmox VE storage."
end_process 1
fi

Expand All @@ -253,18 +265,6 @@ function parse_opts(){
[ "$opt_keep" -le 0 ] && { log info "Keep is not set correctly. Value > 0."; end_process 1; }

snap_name_prefix="barc$opt_label"

if [ $opt_debug -eq 1 ]; then
log info "============================================"
log info "EnterpriseVE BARC Version: $VERSION";
log info "============================================"
log info "Proxmox VE Version:"

#info proxmox
pveversion --verbose

log info "============================================"
fi
}

function get_path(){
Expand Down
2 changes: 1 addition & 1 deletion eve4pve-barc.8.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Environment variables:
EVE4PVE_BARC_PHASE, EVE4PVE_BARC_VMID, EVE4PVE_BARC_PATH, EVE4PVE_BARC_LABEL, EVE4PVE_BARC_KEEP, EVE4PVE_BARC_SNAP_NAME, EVE4PVE_BARC_BACKUP_FILE

.SH IMPORTANT FILES
Cron jobs and config are stored at /etc/cron.d/@@PACKAGE@@
Cron jobs are stored at /etc/cron.d/@@PACKAGE@@

.SH COPYRIGHT AND DISCLAIMER
@@COPYRIGHT@@

0 comments on commit dcc10fd

Please sign in to comment.