Move save.game script to specific directory

This commit is contained in:
Jeremy Gardais 2019-10-07 20:48:17 +02:00
parent 9ae6f2eecf
commit 43f682d7e8
1 changed files with 22 additions and 2 deletions

View File

@ -1,5 +1,26 @@
#!/bin/sh #!/bin/sh
# Purpose {{{
## Try to centralize all game's save in order to:
## easily backup all save
## easily restore it
## be able to access it from anywhere
## … all you can do with a Nextcloud (share, versionning,…)
##
## 1. Move save directories of a list of known games from Steam's
## userdata to a remote directory (Nextcloud, remote mount,…).
## Then create a symlink in userdata directory to the remote game
## directory.
##
## 2. If a directory doesn't exist, check if a remote one is
## available and symlink it.
##
## TODO: 3. List directories without symlinks.
##
## KISS: Only manage save directories from Steam userdata. For other
## paths ($XDG_DATA_HOME,…) check other scripts.
# }}}
# Vars {{{ # Vars {{{
debug=0 debug=0
@ -82,7 +103,6 @@ for game_id in ${steam_games}; do
local_game_path="${local_steam_userdata}/${game_id}" local_game_path="${local_steam_userdata}/${game_id}"
local_game_path_type="$(file ${local_steam_userdata}/${game_id} | cut -d' ' -f2)" local_game_path_type="$(file ${local_steam_userdata}/${game_id} | cut -d' ' -f2)"
case ${local_game_path_type} in case ${local_game_path_type} in
## Data is already a symlink ## Data is already a symlink
"symbolic") "symbolic")
@ -102,6 +122,6 @@ for game_id in ${steam_games}; do
exit 3 exit 3
;; ;;
esac esac
# }}}
done done
# }}}