RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Script to Backup Save States and SRAM

    Scheduled Pinned Locked Moved Ideas and Development
    backupsave statessram
    2 Posts 2 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jrburke99J
      jrburke99
      last edited by

      sudo nano /home/pi/RetroPie/retropiemenu/Backup_Game_Saves.sh
      
      #!/bin/bash
      
      rsync -av --exclude '/backups' --include '*/' --include '*.srm*' --include '*.bsv*' --include '*.sav*' --include '*.sta*' --include '*.fs*' --include '*.nv*' --include '*.rtc*' --exclude '*' /home/pi/RetroPie/roms/ /home/pi/RetroPie/roms/backups
      
      sleep 3
      

      Save the file and exit.

      Make executable:

      sudo chmod +x /home/pi/RetroPie/retropiemenu/Backup_Game_Saves.sh
      

      Save in /home/pi/RetroPie/retropiemenu folder to be able to launch from the RetroPie menu within ES.

      When run, it will create a folder named "backups" in your roms folder. It will re-create an empty folder structure reflecting your entire roms folder. Then it will copy over any sram and save state files. On subsequent runs, it will skip anything that already exists, and overwrite if there is a newer file available. Then connect to \\retropie from your PC, and copy the backups folder off. If you ever need to resotre, just copy the contents of the backups folder to your roms folder on your re-built Pi, and it will move the files into the correct folders.

      1 Reply Last reply Reply Quote 1
      • cyperghostC
        cyperghost
        last edited by

        Cool solution ;)

        I posted annother small script for such purposes here
        This creates a zip file for each rom and takes as backup the same folder as the rom located.

        It took annother branch instead of searching all files that "could" be a savestate I said, every file with same name except the ROM-name is a savefile.

        Thanks for this small script. I appreciate it :)

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        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.