diff options
Diffstat (limited to 'quickLedger.sh')
-rwxr-xr-x | quickLedger.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/quickLedger.sh b/quickLedger.sh index b0b9879..d7b061b 100755 --- a/quickLedger.sh +++ b/quickLedger.sh @@ -84,6 +84,11 @@ while getopts ':tf:r:c:' opt; do done shift $((OPTIND - 1)) +[ -z "$remoteLedgerFile" ] && + fatalError 'No remote ledger file. Set ledger file as REMOTE_LEDGER_FILE variable or with -r option.\n' 2 + +rsync -tz "$remoteLedgerFile" "$ledgerFile" || fatalError 'rsync failed.' 4 + [ -z "$ledgerFile" ] && fatalError 'No ledger file. Set ledger file as LEDGER_FILE variable or with -f option.\n' 2 [ ! -f "$ledgerFile" ] && fatalError "No file [${ledgerFile}] found to use as ledger.\n" 3 @@ -114,4 +119,4 @@ read -r correct printf '\n' >> "$ledgerFile" getTransaction >> "$ledgerFile" -rsync -t "$ledgerFile" "$remoteLedgerFile" || fatalError 'rsync failed.' 4 +rsync -tz "$ledgerFile" "$remoteLedgerFile" || fatalError 'rsync failed.' 4 |