[Script] One-liner to backup or disable the gamelists in all rom directories
Clyde last edited by Clyde
I just wrote this for myself to "disable" all of the gamelists in all of my rom directories to test new gamelists in
~/.emulationstation/gamelists, since Emulation Station seems to prefer the former if both are present. Then I thought, sharing is caring. :)
Disable all gamelists by adding
.disabledto their names:
for i in ~/RetroPie/roms/*/; do mv -v "$i/gamelist.xml" "$i/gamelist.xml.disabled"; done
Enabling them again:
for i in ~/RetroPie/roms/*/; do mv -v "$i/gamelist.xml.disabled" "$i/gamelist.xml"; done
These lines have to be executed in Retropie's console that you land in by pressing F4 in Emulation station. The command
exitwill get you back to ES.
This variant would be a simple backup. It copies the files instead of renaming them.
for i in ~/RetroPie/roms/*/; do cp -v "$i/gamelist.xml" "$i/gamelist.xml.backup"; done
for i in ~/RetroPie/roms/*/; do cp -v "$i/gamelist.xml.backup" "$i/gamelist.xml"; done
But be careful,
cpwill overwrite any existing files (e.g. an existing gamelist.xml or gamelist.xml.backup) without warning or query.
~/.emulationstation/gamelists/*/to use it on the gamelists in that location.
- If you put these lines into text files inside a directory
binin your pi user's home directory (i.e.
/home/pi/bin) and make them executable by the command
chmod u+x ~/bin/filename, you can run them just by their names from anywhere in the directory tree.
edit: Changed the chmod command to
~/bin/filenamefor (maybe) better understanding. :)