summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeddy70 <6915421+neddy70@users.noreply.github.com>2018-03-18 21:54:36 +1100
committerNeddy70 <6915421+neddy70@users.noreply.github.com>2018-03-18 21:54:36 +1100
commit9f9a4945e29448397089db36596741b977b9ef81 (patch)
tree8aad677182062335e1c7cb471cb308818196efa2
parentb0654c96e0ebbbbd5780f1f16f5b0ae4816f1717 (diff)
parent1a731243f7e32f6a7773df1f71fdcacab86efd3a (diff)
Merge branch 'expiration-strategy' into no-auto-expire
Merge upstream fixes
-rwxr-xr-xrsync_tmbackup.sh6
1 files changed, 1 insertions, 5 deletions
diff --git a/rsync_tmbackup.sh b/rsync_tmbackup.sh
index 6c6c58c..63a863f 100755
--- a/rsync_tmbackup.sh
+++ b/rsync_tmbackup.sh
@@ -55,9 +55,6 @@ fn_display_usage() {
}
fn_parse_date() {
- local date_string="$1"
- local date_format="$2"
-
# Converts YYYY-MM-DD-HHMMSS to YYYY-MM-DD HH:MM:SS and then to Unix Epoch.
case "$OSTYPE" in
linux*) date -d "${1:0:10} ${1:11:2}:${1:13:2}:${1:15:2}" +%s ;;
@@ -98,8 +95,7 @@ fn_expire_backups() {
# Process each backup dir from most recent to oldest
for backup_dir in $(fn_find_backups | sort -r); do
local backup_date=$(basename "$backup_dir")
- local backup_day=${backup_date:0:10}
- local backup_timestamp=$(fn_parse_date $backup_day "Y-m-d")
+ local backup_timestamp=$(fn_parse_date "$backup_date")
# Skip if failed to parse date...
if [ -z "$backup_timestamp" ]; then