diff options
| author | Robert Bruce Park <r@robru.ca> | 2013-11-13 10:53:13 -0800 |
|---|---|---|
| committer | Robert Bruce Park <r@robru.ca> | 2013-11-13 10:53:13 -0800 |
| commit | 584e3a9b4bed54d671174555a184ef3f40ff8dff (patch) | |
| tree | fc94dcb76023ad2dd213dc05b4d16841b8d5528f | |
| parent | 19446c24b9821cd8771bff8992ac8770dae599bd (diff) | |
Drop BACKUP_FOLDER_PATTERN since it's now only used in one place.
| -rw-r--r-- | rsync_tmbackup.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rsync_tmbackup.sh b/rsync_tmbackup.sh index 67d22d1..7b0f7a6 100644 --- a/rsync_tmbackup.sh +++ b/rsync_tmbackup.sh @@ -32,11 +32,12 @@ trap 'fn_terminate_script' SIGINT # ----------------------------------------------------------------------------- fn_parse_date() { + # Converts YYYY-MM-DD-HHMMSS to YYYY-MM-DD HH:MM:SS and then to Unix Epoch. date -d "${1:0:10} ${1:11:2}:${1:13:2}:${1:15:2}" +%s } fn_find_backups() { - find "$DEST_FOLDER" -type d -name "$BACKUP_FOLDER_PATTERN" -prune + find "$DEST_FOLDER" -type d -name "????-??-??-??????" -prune } fn_expire_backup() { @@ -92,7 +93,6 @@ fi # ----------------------------------------------------------------------------- export IFS=$'\n' # Better for handling spaces in filenames. -BACKUP_FOLDER_PATTERN=????-??-??-?????? NOW=$(date +"%Y-%m-%d-%H%M%S") PROFILE_FOLDER="$HOME/.rsync_tmbackup" LOG_FILE="$PROFILE_FOLDER/$NOW.log" |
