3 # a helpful script that scrapes any active game saves from wine's storage
4 # area into a spooling saves folder for archiving.
6 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
8 # copies the files for a particular game out to a spooling folder.
12 source_dir="$1"; shift
15 if [ -d "$source_dir" -a $(ls "$source_dir" 2>/dev/null | wc -c) != 0 ]; then
17 if [ ! -d "$out_dir" ]; then
19 exit_on_error "Creating storage dir: $out_dir"
21 netcp "$source_dir"/* "$out_dir"/
28 # run through and copy our save files from the potentially weird locations they reside in.
29 # this requires a single argument, which is the top-level directory of the game storage.
30 function copy_all_save_games()
32 local WINE_GOODS_DIR="$1"
34 local WINE_GAMES_DIR="$WINE_GOODS_DIR/My Games"
35 local SPOOLING_OUTPUT_DIR="$HOME/data/spooling_saves"
37 if [ ! -d "$WINE_GAMES_DIR" ]; then
38 echo "Failing to find the game save directories."
42 if [ ! -d "$SPOOLING_OUTPUT_DIR" ]; then
43 mkdir -p "$SPOOLING_OUTPUT_DIR"
44 exit_on_error Creating spooling output directory.
49 copyem "skyrim" "$WINE_GAMES_DIR/Skyrim/Saves" "$SPOOLING_OUTPUT_DIR/skyrim"
51 copyem "fallout new vegas" "$WINE_GAMES_DIR/FalloutNV/Saves" "$SPOOLING_OUTPUT_DIR/fallout_new_vegas"
53 copyem "fallout 3" "$WINE_GAMES_DIR/Fallout3/Saves" "$SPOOLING_OUTPUT_DIR/fallout_3"
55 copyem "oblivion" "$WINE_GAMES_DIR/Oblivion/Saves" "$SPOOLING_OUTPUT_DIR/oblivion/"
57 copyem "fallout 4" "$WINE_GAMES_DIR/Fallout4/Saves" "$SPOOLING_OUTPUT_DIR/fallout_4"
59 copyem "witcher 3" "$WINE_GOODS_DIR/The Witcher 3/gamesaves" "$SPOOLING_OUTPUT_DIR/witcher_3"
62 # mainline of script tries out a few locations to back up.
64 # first try our play on linux storage. very individualized for fred.
65 wine_goods_dir="$HOME/linx/wine_goods"
66 if [ ! -d "$wine_goods_dir" ]; then
67 wine_goods_dir="/cygdrive/c/users/fred/My Documents"
69 if [ ! -d "$wine_goods_dir" ]; then
70 echo "not trying to back up any wine goods; could not find an appropriate folder."
72 copy_all_save_games "$wine_goods_dir"
75 # now try the main linux steam save game storage area, which is also fred specific.
76 # this uses a link in the home directory called steam_goods which is connected to
77 # "$HOME/.steam/steam/SteamApps/compatdata/MYNUM/pfx/drive_c/users/steamuser/My Documents"
78 # where MYNUM is replaced with one's steam ID number.
79 wine_goods_dir="$HOME/linx/steam_goods"
80 if [ ! -d "$wine_goods_dir" ]; then
81 echo "not trying to back up any steam goods; could not find an appropriate folder."
83 copy_all_save_games "$wine_goods_dir"