Merge branch 'expiration-strategy' into no-auto-expire
Merge upstream fixes
This commit is contained in:
+1
-5
@@ -55,9 +55,6 @@ fn_display_usage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn_parse_date() {
|
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.
|
# Converts YYYY-MM-DD-HHMMSS to YYYY-MM-DD HH:MM:SS and then to Unix Epoch.
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
linux*) date -d "${1:0:10} ${1:11:2}:${1:13:2}:${1:15:2}" +%s ;;
|
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
|
# Process each backup dir from most recent to oldest
|
||||||
for backup_dir in $(fn_find_backups | sort -r); do
|
for backup_dir in $(fn_find_backups | sort -r); do
|
||||||
local backup_date=$(basename "$backup_dir")
|
local backup_date=$(basename "$backup_dir")
|
||||||
local backup_day=${backup_date:0:10}
|
local backup_timestamp=$(fn_parse_date "$backup_date")
|
||||||
local backup_timestamp=$(fn_parse_date $backup_day "Y-m-d")
|
|
||||||
|
|
||||||
# Skip if failed to parse date...
|
# Skip if failed to parse date...
|
||||||
if [ -z "$backup_timestamp" ]; then
|
if [ -z "$backup_timestamp" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user