Files
RetroPieBackup/RetroPieSaveGameBackup.sh

14 lines
576 B
Bash
Raw Permalink Normal View History

2022-01-28 14:55:39 +01:00
#!/bin/bash
#
# Simple script to backup savegames and roms to a network share on each game end/shut down
2022-01-28 15:52:29 +01:00
# Save the file at /home/pi/.emulationstation/scripts/quit/ and it will run automatically on shutdown
2022-01-28 14:55:39 +01:00
2022-02-15 01:02:46 +01:00
BACKUPPATH="/mnt/megabyte/Retro Games/Roms"
LOCALPATH="/home/pi/RetroPie/roms"
2022-01-28 14:55:39 +01:00
# Search through folders for *.srm files
# Copy *.srm files from the folders, into network share with the same parent folder
2022-02-15 01:02:46 +01:00
find $LOCALPATH -name *.srm | while read filepath; do dir="$(echo $filepath | awk -F'/' '{print $(NF-1)}')"; cp -v "$filepath" "$BACKUPPATH/$dir/."; done;
2022-01-28 14:55:39 +01:00
# Exit