minor fixes
This commit is contained in:
parent
3e84ea65e3
commit
cd6dfdda40
11
btrbk
11
btrbk
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
source /etc/btrbk.conf
|
|
||||||
startDate=$(date +%s)
|
startDate=$(date +%s)
|
||||||
|
|
||||||
function bkRun {
|
function bkRun {
|
||||||
|
@ -101,6 +100,7 @@ function getSnap {
|
||||||
|
|
||||||
|
|
||||||
function testConf {
|
function testConf {
|
||||||
|
source /etc/btrbk.conf
|
||||||
if [ -z ${rDate+x} ]; then
|
if [ -z ${rDate+x} ]; then
|
||||||
if ! date -d "$rDate" > /dev/null 2>&1; then
|
if ! date -d "$rDate" > /dev/null 2>&1; then
|
||||||
echo "date is in wrong format: YYYY-MM-DD"
|
echo "date is in wrong format: YYYY-MM-DD"
|
||||||
|
@ -150,7 +150,7 @@ function echoHelp {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
options=$(getopt -l "backup,force,date:,restore:,full-restore:,help" -o "bfd:r:x:h" -- "$@")
|
options=$(getopt -l "backup,force,date::,restore::,full-restore::,help" -o "bfd::r::x::h" -- "$@")
|
||||||
eval set -- "$options"
|
eval set -- "$options"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
@ -161,14 +161,13 @@ while true; do
|
||||||
-r|--restore) restore=1; restoreVol=$2; shift;;
|
-r|--restore) restore=1; restoreVol=$2; shift;;
|
||||||
-x|--full-restore) fullRestore=1; restoreDir=$2; shift;;
|
-x|--full-restore) fullRestore=1; restoreDir=$2; shift;;
|
||||||
-h|--help) Help; shift; break;;
|
-h|--help) Help; shift; break;;
|
||||||
--) shift;;
|
--) shift; echoHelp;;
|
||||||
\?) echo "error"; exit 1;;
|
\?) echo "error"; exit 1;;
|
||||||
*) echoHelp; shift; break;;
|
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
echo $fullRestore
|
||||||
if [ $fullRestore=1 ]; then
|
if [ $fullRestore = "1" ]; then
|
||||||
runFullRestore
|
runFullRestore
|
||||||
else
|
else
|
||||||
testConf
|
testConf
|
||||||
|
|
Loading…
Reference in a new issue