Manage compatdata saves only for installed games

This commit is contained in:
Jeremy Gardais 2019-10-09 16:50:18 +02:00
parent c6d7579469
commit 4ad2db6a54
1 changed files with 45 additions and 39 deletions

View File

@ -43,6 +43,9 @@ steam_compatdata=".steam/steam/steamapps/compatdata"
### 359840 Shift Happens https://pcgamingwiki.com/wiki/Shift_Happens ### 359840 Shift Happens https://pcgamingwiki.com/wiki/Shift_Happens
steam_userdata_games="760 35700 35720 55230 204360 206420 218820 247080 255870 312530 359840" steam_userdata_games="760 35700 35720 55230 204360 206420 218820 247080 255870 312530 359840"
## }}} ## }}}
## Pattern of Steam saves in common to backup {{{
### 274190 Broforce https://pcgamingwiki.com/wiki/Broforce
# }}}
## Pattern of Steam saves in compatdata to backup {{{ ## Pattern of Steam saves in compatdata to backup {{{
### Compatdata contains directories for games using Steam play so it's too big ### Compatdata contains directories for games using Steam play so it's too big
### to be fully moved to a remote storage. ### to be fully moved to a remote storage.
@ -55,9 +58,6 @@ steam_userdata_games="760 35700 35720 55230 204360 206420 218820 247080 255870 3
### 686200 Door Kickers: Action Squad https://pcgamingwiki.com/wiki/Door_Kickers:_Action_Squad ### 686200 Door Kickers: Action Squad https://pcgamingwiki.com/wiki/Door_Kickers:_Action_Squad
steam_compatdata_games_pattern="213670/save 312610/UserDefault.xml 686200/userdata.bin" steam_compatdata_games_pattern="213670/save 312610/UserDefault.xml 686200/userdata.bin"
# }}} # }}}
## List of Steam saves in steamapps to backup {{{
### 274190 Broforce https://pcgamingwiki.com/wiki/Broforce
# }}}
## Ids without backups in userdata {{{ ## Ids without backups in userdata {{{
### 7 Unknown ### 7 Unknown
### 620 Portal 2 https://pcgamingwiki.com/wiki/Portal_2 ### 620 Portal 2 https://pcgamingwiki.com/wiki/Portal_2
@ -183,6 +183,9 @@ for game_pattern in ${steam_compatdata_games_pattern}; do
game_id="$(echo ${game_pattern} | cut -d"/" -f1)" game_id="$(echo ${game_pattern} | cut -d"/" -f1)"
save_pattern="$(echo ${game_pattern} | cut -d"/" -f2)" save_pattern="$(echo ${game_pattern} | cut -d"/" -f2)"
## If the game is installed
if [ -d "${HOME}/${steam_compatdata}/${game_id}" ]; then
### Follow symbolic links but avoid links to dosdevices and keep only one result ### Follow symbolic links but avoid links to dosdevices and keep only one result
temp_local_save_path="$(find -L "${HOME}/${steam_compatdata}/${game_id}" -ipath "*dosdevices*" -prune -o -iname "${save_pattern}" | grep -v "dosdevices" | head -n 1)" temp_local_save_path="$(find -L "${HOME}/${steam_compatdata}/${game_id}" -ipath "*dosdevices*" -prune -o -iname "${save_pattern}" | grep -v "dosdevices" | head -n 1)"
local_save_path="$(dirname "${temp_local_save_path}")" local_save_path="$(dirname "${temp_local_save_path}")"
@ -221,6 +224,9 @@ for game_pattern in ${steam_compatdata_games_pattern}; do
exit 3 exit 3
;; ;;
esac esac
else ## The game is not present on the system
[ "${debug}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG: Steam compatdata for loop — ${game_id} doesn't seems to be installed on the system. Skip."
fi
done done
# }}} # }}}