From 5a66c6b72c82baa127e4f2687bcc8f983d27b68a Mon Sep 17 00:00:00 2001 From: Adar Nimrod Date: Thu, 17 Aug 2017 18:23:10 +0300 Subject: [PATCH] - A little cleaner. --- .bashrc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index 0b707e0..74a0597 100644 --- a/.bashrc +++ b/.bashrc @@ -146,9 +146,10 @@ docker_dev () { } sync_comics () { - local this_month last_month - this_month="$( date '+xbmc.shore.co.il:/srv/library/Comics/0-Day\ Week\ of\ %Y.%m.*' )" - last_month="$( date --date '1 month ago' '+xbmc.shore.co.il:/srv/library/Comics/0-Day\ Week\ of\ %Y.%m.*' )" + local this_month last_month format + format='+xbmc.shore.co.il:/srv/library/Comics/0-Day\ Week\ of\ %Y.%m.*' + this_month="$( date "$format" )" + last_month="$( date --date '1 month ago' "$format" )" rsync --prune-empty-dirs --ignore-missing-args --recursive --compress --progress --exclude "*.part" "$last_month" "$this_month" "$HOME/Downloads/Comics/" find "$HOME/Downloads/Comics/" -name "$(date --date '2 month ago' +'0-Day\ Week\ of\ %Y.%m.*')" -exec rm -r {} + } -- GitLab