From cf446c745e42bee7eb77bab0e161f754641c2b9d Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Wed, 20 Jul 2016 08:51:30 -0400 Subject: [PATCH] updated to use vars for the paths and added comments. --- customizing/fred/scripts/gamesaver.sh | 40 +++++++++++++++++++-------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/customizing/fred/scripts/gamesaver.sh b/customizing/fred/scripts/gamesaver.sh index def0d89a..1e9c5295 100644 --- a/customizing/fred/scripts/gamesaver.sh +++ b/customizing/fred/scripts/gamesaver.sh @@ -1,20 +1,36 @@ +#!/bin/bash -# hmmm: some better work could be done to have both names (wineprefix and storage dir) be iterable. +# a helpful script that scrapes any active game saves from wine's storage +# area into a spooling saves folder for archiving. + +WINE_SOURCE_DIR="$HOME/wine_goods/My Games" +SPOOLING_OUTPUT_DIR="$HOME/spooling_saves" + +function line() +{ + echo "=======" +} + +# make the output folders if they don't exist. for i in oblivion fallout_new_vegas fallout_3 skyrim ; do - if [ ! -d $HOME/spooling_saves/$i ]; then - mkdir -p $HOME/spooling_saves/$i + if [ ! -d "$SPOOLING_OUTPUT_DIR/$i" ]; then + mkdir -p "$SPOOLING_OUTPUT_DIR/$i" fi done -echo "=======" + +# now run through and copy our save files from the potentially weird +# locations they reside in. +line echo skyrim -cp -v -n ~/wine_goods/My\ Games/Skyrim/Saves/* ~/spooling_saves/skyrim/ -echo "=======" +cp -v -n "$WINE_SOURCE_DIR/Skyrim/Saves"/* "$SPOOLING_OUTPUT_DIR/skyrim/" +line echo fallout new vegas -cp -v -n ~/wine_goods/My\ Games/FalloutNV/Saves/* ~/spooling_saves/fallout_new_vegas/ -echo "=======" +cp -v -n "$WINE_SOURCE_DIR/FalloutNV/Saves"/* "$SPOOLING_OUTPUT_DIR/fallout_new_vegas/" +line echo fallout 3 -cp -v -n ~/wine_goods/My\ Games/Fallout3/Saves/Player1/* ~/spooling_saves/fallout_3/ -echo "=======" +cp -v -n "$WINE_SOURCE_DIR/Fallout3/Saves/Player1"/* "$SPOOLING_OUTPUT_DIR/fallout_3/" +line echo oblivion -cp -v -n ~/wine_goods/My\ Games/Oblivion/Saves/* ~/spooling_saves/oblivion/ -echo "=======" +cp -v -n "$WINE_SOURCE_DIR/Oblivion/Saves"/* "$SPOOLING_OUTPUT_DIR/oblivion/" +line + -- 2.34.1