Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

[Script] One-liner to backup or disable the gamelists in all rom directories



  • Hi!

    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 .disabled to 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 exit will 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
    

    Restore:

    for i in ~/RetroPie/roms/*/; do cp -v "$i/gamelist.xml.backup" "$i/gamelist.xml"; done
    

    But be careful, cp will overwrite any existing files (e.g. an existing gamelist.xml or gamelist.xml.backup) without warning or query.

    Comments:

    • Change ~/RetroPie/roms/*/ to ~/.emulationstation/gamelists/*/ to use it on the gamelists in that location.
    • If you copy these lines into text files in a directory bin in your pi user's home directory, and make them executable by the command chmod u+x ~/bin/filename, you can run them just by their names.

    edit: Changed the chmod command to ~/bin/filename for (maybe) better understanding. :)



Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.