diff --git a/helpers/shells/getLastSave.sh b/helpers/shells/getLastSave.sh index 452a000..a7ca79f 100755 --- a/helpers/shells/getLastSave.sh +++ b/helpers/shells/getLastSave.sh @@ -26,6 +26,10 @@ fi # Default value if .env not exists : "${home:=/home/borgwarehouse}" -stat --format='{"repositoryName":"%n","lastSave":%Y}' \ +if [ -n "$(find ${home}/repos -mindepth 1 -maxdepth 1 -type d)" ]; then + stat --format='{"repositoryName":"%n","lastSave":%Y}' \ ${home}/repos/*/integrity* | - jq --slurp '[.[] | .repositoryName = (.repositoryName | split("/")[-2])]' \ No newline at end of file + jq --slurp '[.[] | .repositoryName = (.repositoryName | split("/")[-2])]' +else + echo "[]" +fi \ No newline at end of file