From 23be650eac439e6e0b93fb13ae96a256539f0f9e Mon Sep 17 00:00:00 2001
From: "flyingscorpio@arch-desktop" <tfranken@protonmail.com>
Date: Tue, 8 Sep 2020 14:43:20 +0200
Subject: [PATCH] When using -f the variable 'cache_file' was not set

---
 arch-desktop_borg.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch-desktop_borg.sh b/arch-desktop_borg.sh
index 27326a8..e9e7c9e 100755
--- a/arch-desktop_borg.sh
+++ b/arch-desktop_borg.sh
@@ -16,10 +16,10 @@ print_help() {
   awk -F'### ' '/^###/ { print $2 }' "$0"
 }
 
+cache_file='/home/flyingscorpio/.cache/borg_backup_hook_last_executed'
 stat_cache_file() {
   # We only want this file to be executed at most once per day, so we stat a cache
   # file before running the rest of the code
-  cache_file='/home/flyingscorpio/.cache/borg_backup_hook_last_executed'
   if [ -f "$cache_file" ]; then
     cache_stat=$(stat -c %y "$cache_file" | cut -d' ' -f1)
     today=$(date +%Y-%m-%d)