Skip to content

Commit e0965ce

Browse files
committed
Add: Debugging
1 parent 79931bb commit e0965ce

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/backup_plex.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,13 @@ main() {
488488
fi
489489
hex_to_decimal "$bar_color"
490490
check_config "$@"
491-
last_plex_backup="$(date -r "${config_dir}/.last_plex_backup.tmp" +%s)"
491+
last_plex_backup="$config_dir/.last_plex_backup.tmp"
492492
# check for .last_plex_backup.tmp file and if it exists, read the file to get the last backup date
493+
if [ ! -f "$last_plex_backup" ]; then
494+
verbose_output "Creating last backup file"
495+
touch "$last_plex_backup"
496+
fi
497+
493498
if [ -f "$last_plex_backup" ]; then
494499
while IFS= read -r line; do
495500
lastbackup=$line
@@ -498,9 +503,8 @@ main() {
498503
lastbackup=0
499504
fi
500505
if [ "$debug" == "True" ]; then
506+
echo "Config Dir: $config_dir"
501507
echo "Last Plex Backup: $last_plex_backup"
502-
fi
503-
if [ "$debug" == "True" ]; then
504508
echo "Last backup: $lastbackup"
505509
fi
506510
# get current date

0 commit comments

Comments
 (0)