From 22fc0c0c5a5327db955cb08072f468a0db11b1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Thu, 25 May 2023 15:52:52 +0200 Subject: [PATCH] Prepare directory for partial account statements and checking modification time. --- fetch_fio.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fetch_fio.sh b/fetch_fio.sh index 03be274..f4f2477 100644 --- a/fetch_fio.sh +++ b/fetch_fio.sh @@ -92,12 +92,25 @@ else APIKEYS_FILE="$ARG_APIKEYS_FILE" fi +# Storage for partial account statements +BANK_DIR_PARTS="$BANK_DIR/parts" +if ! [ -d "$BANK_DIR_PARTS" ] ; then + mkdir -p "$BANK_DIR_PARTS" +fi + # # Very simple "logging" function (stdout should be redirected to log anyway) log() { echo `date '+%Y-%m-%d %H:%M:%S'` "$@" } +# +# Returns the file modification date in YYYY-MM-DD format +get_file_date() { + STAT=`stat -c %y "$1"` + echo ${STAT%% *} +} + # Mark log "$0" ======== started ========