Skip to content

Commit

Permalink
Added option to back up just saves or games
Browse files Browse the repository at this point in the history
  • Loading branch information
nathnp committed May 9, 2024
1 parent ed12f60 commit a267a86
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This tool will back up your games, and save files from your playdate to your com

- You can do this by going to Settings -> System -> Reboot to Data Disk -> OK on your Playdate

3. Run the script `./PDBackup.sh`
3. Run the script `./PDBackup.sh` and choose if you want to back up just your saves, or games, or both.

## Scrip is Throwing Error

Expand Down
45 changes: 37 additions & 8 deletions src/LinuxM/PDBackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,51 @@ if [ ! -d "$folder" ]; then
exit 1
fi

printf "Would you like to back up Games, Saves, or Both [g,s,b] "
read choice

printf "Enter date, no spaces please "
read tdate

printf "Copying saves, this may take a moment\n"
cp -r $folder/Data .
mkdir -p Playdate

if [ $choice == "g" ]; then

printf "Copying games, this WILL take a while\n"
cd Playdate
cp -r $folder/Games .
cd ..
fi

if [ $choice == "s" ]; then

printf "Copying saves, this may take a moment\n"
cd Playdate
cp -r $folder/Data .
cd ..

fi

printf "Copying games, this WILL take a while\n"
cp -r $folder/Games .
if [ $choice == "b" ]; then

printf "Copying saves, this may take a moment\n"
cd Playdate
cp -r $folder/Data .
cd ..

printf "Copying games, this WILL take a while\n"
cd Playdate
cp -r $folder/Games .
cd ..

fi

printf "Tarballing Saves and Games\n"
tar cf PDSavesNGames$tdate.tar Data/ Games/
tar cf PDBackup$tdate.tar Playdate/

printf "Gziping tarball\n"
gzip PDSavesNGames$tdate.tar
gzip PDBackup$tdate.tar

rm -rf Data
rm -rf Games
rm -rf Playdate

printf "Done\n"
45 changes: 37 additions & 8 deletions src/LinuxR/PDBackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,51 @@ if [ ! -d "$folder" ]; then
exit 1
fi

printf "Would you like to back up Games, Saves, or Both [g,s,b] "
read choice

printf "Enter date, no spaces please "
read tdate

printf "Copying saves, this may take a moment\n"
cp -r $folder/Data .
mkdir -p Playdate

if [ $choice == "g" ]; then

printf "Copying games, this WILL take a while\n"
cd Playdate
cp -r $folder/Games .
cd ..
fi

if [ $choice == "s" ]; then

printf "Copying saves, this may take a moment\n"
cd Playdate
cp -r $folder/Data .
cd ..

fi

printf "Copying games, this WILL take a while\n"
cp -r $folder/Games .
if [ $choice == "b" ]; then

printf "Copying saves, this may take a moment\n"
cd Playdate
cp -r $folder/Data .
cd ..

printf "Copying games, this WILL take a while\n"
cd Playdate
cp -r $folder/Games .
cd ..

fi

printf "Tarballing Saves and Games\n"
tar cf PDSavesNGames$tdate.tar Data/ Games/
tar cf PDBackup$tdate.tar Playdate/

printf "Gziping tarball\n"
gzip PDSavesNGames$tdate.tar
gzip PDBackup$tdate.tar

rm -rf Data
rm -rf Games
rm -rf Playdate

printf "Done\n"
45 changes: 37 additions & 8 deletions src/mac/PDBackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,51 @@ if [ ! -d "$folder" ]; then
exit 1
fi

printf "Would you like to back up Games, Saves, or Both [g,s,b] "
read choice

printf "Enter date, no spaces please "
read tdate

printf "Copying saves, this may take a moment\n"
cp -r $folder/Data .
mkdir -p Playdate

if [ $choice == "g" ]; then

printf "Copying games, this WILL take a while\n"
cd Playdate
cp -r $folder/Games .
cd ..
fi

if [ $choice == "s" ]; then

printf "Copying saves, this may take a moment\n"
cd Playdate
cp -r $folder/Data .
cd ..

fi

printf "Copying games, this WILL take a while\n"
cp -r $folder/Games .
if [ $choice == "b" ]; then

printf "Copying saves, this may take a moment\n"
cd Playdate
cp -r $folder/Data .
cd ..

printf "Copying games, this WILL take a while\n"
cd Playdate
cp -r $folder/Games .
cd ..

fi

printf "Tarballing Saves and Games\n"
tar cf PDSavesNGames$tdate.tar Data/ Games/
tar cf PDBackup$tdate.tar Playdate/

printf "Gziping tarball\n"
gzip PDSavesNGames$tdate.tar
gzip PDBackup$tdate.tar

rm -rf Data
rm -rf Games
rm -rf Playdate

printf "Done\n"

0 comments on commit a267a86

Please sign in to comment.