From f22092722742b59df698bfc75046c61fe2761a52 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Thu, 17 Aug 2023 13:38:18 -0400 Subject: [PATCH] Corrections to backup function --- functions/functions.sh | 1 + functions/global.sh | 12 +++++++----- tools/configurator.sh | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/functions/functions.sh b/functions/functions.sh index 0dade626..7bcc6499 100644 --- a/functions/functions.sh +++ b/functions/functions.sh @@ -261,6 +261,7 @@ update_rpcs3_firmware() { } backup_retrodeck_userdata() { + mkdir -p "$backups_folder" zip -rq9 "$backups_folder/$(date +"%0m%0d")_retrodeck_userdata.zip" "$saves_folder" "$states_folder" "$bios_folder" "$media_folder" "$themes_folder" "$logs_folder" "$screenshots_folder" "$mods_folder" "$texture_packs_folder" "$borders_folder" > $logs_folder/$(date +"%0m%0d")_backup_log.log } diff --git a/functions/global.sh b/functions/global.sh index 58223622..93dbb93c 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -28,18 +28,16 @@ finit_options_list="$emuconfigs/defaults/retrodeck/reference_lists/finit_options splashscreen_dir="/var/config/emulationstation/.emulationstation/resources/graphics/extra_splashes" # The default location of extra splash screens current_splash_file="/var/config/emulationstation/.emulationstation/resources/graphics/splash.svg" # The active splash file that will be shown on boot default_splash_file="/var/config/emulationstation/.emulationstation/resources/graphics/splash-orig.svg" # The default RetroDECK splash screen -multi_user_data_folder="$rdhome/multi-user-data" # The default location of multi-user environment profiles multi_user_emulator_config_dirs="$emuconfigs/defaults/retrodeck/reference_lists/multi_user_emulator_config_dirs.cfg" # A list of emulator config folders that can be safely linked/unlinked entirely in multi-user mode -backups_folder="$rdhome/backups" # A standard location for backup file storage rd_es_themes="/app/share/emulationstation/themes" # The directory where themes packaged with RetroDECK are stored lockfile="/var/config/retrodeck/.lock" # where the lockfile is located default_sd="/run/media/mmcblk0p1" # Steam Deck SD default path hard_version="$(cat '/app/retrodeck/version')" # hardcoded version (in the readonly filesystem) rd_repo="https://github.com/XargonWan/RetroDECK" # The URL of the main RetroDECK GitHub repo es_themes_list="https://gitlab.com/es-de/themes/themes-list/-/raw/master/themes.json" # The URL of the ES-DE 2.0 themes list -remote_network_target_1="https://flathub.org" # The URL of a common internet target for testing network access -remote_network_target_2="$rd_repo" # The URL of a common internet target for testing network access -remote_network_target_3="https://one.one.one.one" # The URL of a common internet target for testing network access +remote_network_target_1="https://flathub.org" # The URL of a common internet target for testing network access +remote_network_target_2="$rd_repo" # The URL of a common internet target for testing network access +remote_network_target_3="https://one.one.one.one" # The URL of a common internet target for testing network access helper_files_folder="$emuconfigs/defaults/retrodeck/helper_files" # The parent folder of RetroDECK documentation files for deployment helper_files_list="$emuconfigs/defaults/retrodeck/reference_lists/helper_files_list.cfg" # The list of files to be deployed and where they go rd_appdata="/app/share/appdata/net.retrodeck.retrodeck.appdata.xml" # The shipped appdata XML file for this version @@ -174,4 +172,8 @@ else prepare_emulator "all" "postmove" conf_write fi + + # Static variables dependent on $rd_conf values, need to be set after reading $rd_conf + backups_folder="$rdhome/backups" # A standard location for backup file storage + multi_user_data_folder="$rdhome/multi-user-data" # The default location of multi-user environment profiles fi diff --git a/tools/configurator.sh b/tools/configurator.sh index dc9dd210..175a7174 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -879,7 +879,7 @@ configurator_retrodeck_troubleshooting_dialog() { --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator Utility - Backup in Progress" \ --text="Backing up RetroDECK userdata, please wait..." - if [[ -f $backups_folder/$(date +"%0m%0d")_retrodeck_userdata.zip ]]; then + if [[ -f "$backups_folder/$(date +"%0m%0d")_retrodeck_userdata.zip" ]]; then configurator_generic_dialog "RetroDECK Configurator - Backup: RetroDECK Userdata" "The backup process is now complete." else configurator_generic_dialog "RetroDECK Configurator - Backup: RetroDECK Userdata" "The backup process could not be completed,\nplease check the logs folder for more information."