• 0 Votes
    8 Posts
    2k Views
    SixSpeedDeathS

    Bump? Still looking for any way to modify the USB Sync script to only sync saves. I ended up trying to modify the 01_retropie_copyroms file, but it hangs up on my script.

    What I did was add --exclude '*.xxx" for all the rom files on the ROM/BIOS sync line, and swap the source and destination in the rsync command so it now reads the USB path first, and retropie second. Finally, I tried removing the usermod line, since I'm syncing the filed FROM the pi to USB.

    The script still automounts the USB, and created the file structure (rsync maxdepth=1) but it fails to fill the directory with the save games.

    Still new to scripting (This device is a learning tool) What have I missed?

    #!/bin/bash

    This file is part of The RetroPie Project The RetroPie Project is the legal property of its developers, whose names are too numerous to list here. Please refer to the COPYRIGHT.md file distributed >with this source. See the LICENSE.md file at the top-level directory of this distribution and at https://raw.githubusercontent.com/RetroPie/RetroPie->Setup/master/LICENSE.md config / defaults

    user="pi"

    home="$(eval echo ~$user)"
    rootdir="/opt/retropie"
    retropie_path="$home/RetroPie"

    usb_path="$UM_MOUNTPOINT/retropie"
    usb_path_from_rp="$usb_path/configs/from_retropie"
    usb_path_to_rp="$usb_path/configs/to_retropie"

    declare -A path_mapping

    mapping from usb_path_to_rp/* to retropie location

    path_mapping["configs"]="$rootdir/configs"

    internals

    hook_name=${0##*/}

    functions

    function log() {
    logger -p user.$1 -t usbmount-"$hook_name"-[$$] -- "$2"
    }

    function log_cmd() {
    local ret
    local error
    error="$("$@" 2>&1 >/dev/null)"
    ret=$?
    [[ "$ret" -ne 0 ]] && log err "$* - returned $ret - $error"
    }

    some sanity checking

    if [[ -z "$UM_MOUNTPOINT" ]]; then
    log err "UM_MOUNTPOINT not set!"
    exit 0
    fi

    if [[ ! -d "$UM_MOUNTPOINT" ]]; then
    log err "UM_MOUNTPOINT is not a directory"
    exit 0
    fi

    make sure we have something to sync from

    if [[ ! -d "$usb_path" ]]; then
    exit 0
    fi

    make folders for syncing

    mkdir -p "$usb_path/"{roms,BIOS} "$usb_path_from_rp" "$usb_path_to_rp"

    mirror romdir structure to external drive

    log info "Attempting to create directory structure for ROMS in '$usb_path/roms' >..."

    fetch list of romdirs from current installation and mirror onto external drive

    find "$retropie_path/roms" -mindepth 1 -maxdepth 1 -type d -printf >"$usb_path/roms/%f\n" | xargs mkdir -p 2>/dev/null || true

    copy SAVES ONLY from Local SD card stick to USB

    for dir in roms BIOS; do
    log info "Syncing $dir ..."
    log_cmd rsync -au --exclude '._' --exclude '.32x' --exclude '.bin' --exclude >'.cue' --exclude '.gb' --exclude '.gba' --exclude '.gbc' --exclude '.gen' -->exclude '.gg' --exclude '.md' --exclude '.ndd' --exclude '.nes' --exclude '.pce' >--exclude '.sfc' --exclude '.smc' --exclude '.sms' --exclude '.vb' --exclude >'.z64' --exclude '*.zip' --max-delete=-1 "$retropie_path/" "$usb_path/$dir"
    chown -R $user:$user "$retropie_path/$dir"
    done

    log info "Syncing configs ..."

    copy configs to usb

    for to in "${!path_mapping[@]}"; do
    from=${path_mapping[$to]}
    log_cmd rsync -au --exclude '._*' --max-delete=-1 "$from/" >"$usb_path_from_rp/$to/"
    done

    copy configs from usb

    for from in $(find "$usb_path_to_rp/" -mindepth 1 -maxdepth 1); do

    basename

    from_bn=${from##/}
    to=${path_mapping[$from_bn]}
    if [[ -n "$to" ]]; then
    log_cmd rsync -au --exclude '._' --max-delete=-1 "$from/" "$to/"
    chown -R $user:$user "$to"
    fi
    done

    unmount USB stick

    umount "$UM_MOUNTPOINT"

    I don't use forums either apparently, because I can't find a way to use that nifty box that allows me to add code. the --exclude DOES have a *.xxx, but it doesn't show up.

  • 0 Votes
    7 Posts
    3k Views
    ?

    @mitu

    Hello,

    I had the same problem when making the backup, it would be interesting to add these notes in:
    https://retropie.org.uk/docs/Updating-RetroPie/#making-a-backup
    Change "Make sure you have the correct drive letter for your SD card!" to "Make sure you have the correct drive letter for your SD card! (Choose the partition which is readable by Windows, 'boot' as the source of the backup)" or something similar.

    Thank you.

  • 0 Votes
    3 Posts
    798 Views
    B

    @jonnykesh Alright! That's not so bad :) Guess I should get familiar with gamelist.xml ...

  • 4.2.1 > 4.3.1 custom controls lost

    Help and Support
    1
    0 Votes
    1 Posts
    441 Views
    No one has replied
  • Easy question about backups

    Help and Support
    21
    0 Votes
    21 Posts
    6k Views
    BobHarrisB

    @tmntturtlguy Yes, I'm sure.

  • 1 Votes
    2 Posts
    1k Views
    cyperghostC

    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 :)

  • 0 Votes
    3 Posts
    1k Views
    HurricaneFanH

    @chipsnblip Thank you, that is exactly what I'm looking for.

  • 0 Votes
    2 Posts
    4k Views
    DaistaarD

    Just thought I'd throw this out there and mark this as resolved. For anyone looking to do what I did which is fully configure your RetroPie, then remove your controller configuration for a clean backup solution (Where you can then restore and configure whatever controller you want as it came Out of the Box) all you have to do is this.

    Configure your Raspberry Pi fully (with RetroPie) Make sure all settings are exactly as you'd like with splash screen, themes, core configs, scrapes, roms Delete any save files for the cleanest backups Go to RetroPie > RetroPie Setup > Manage Configurations > EmulationStation > Clear input Configuration Exit to ES, press start on controller and Shutdown System Remove MicroSD card, and insert in computer Create your backup with your favorite backup software, then "Pi shrink" it
  • RPI-Clone Error - Help Please

    Help and Support
    7
    0 Votes
    7 Posts
    2k Views
    TMNTturtlguyT

    All, finally home from my work trip and I updated the rpi-clone tool and it worked perfectly. Thanks for the tip on the new update.

  • 0 Votes
    15 Posts
    14k Views
    MrJordaaanyM

    @RedBatman not much you can do unless you shrink the free space down on your installation. I'm sure there's a Linux command you can run to do that. But then each time you move the image back to your sd card you will have to rememeber to expand the file system again.

  • Image backup

    Help and Support
    2
    0 Votes
    2 Posts
    929 Views
    Muntic0reM

    Disk drill can help to restore deletes images. For instance, with it help I recover deleted photos on my mac. With step-by-step instruction it's easy to do even for me :)

  • Backup and Restore Settings

    Help and Support
    3
    0 Votes
    3 Posts
    3k Views
    AlexMurphyA

    @DarkWolf I use a bash GUI. It has options for Kodi, RetroPie, PIXEL desktop, MC File Manager, RP SetUp Script, System info, reboot & shutdown. Just pick the option and it launches. Any script could be launched from it, including the type proposed by the OP.

    Another, option is for him to create the script and just set up a bash alias. So a special codeword or password could just be entered in the shell and the script would run.

    So handy for people not familiar with the system. The Pi is basically the living room home entertainment system. In a computer not much bigger than a credit card. What a time to be alive!

  • -1 Votes
    6 Posts
    2k Views
    meleuM

    @Freakadude said in Strange cloned RetroPie Image issue!:

    This is a self backup and restore issue/question.

    Sorry for assuming you were using a 3rd party image. I hope our fellows posts above helped you.

    Cheers!

  • Network Speed

    Help and Support
    19
    0 Votes
    19 Posts
    6k Views
    caver01C

    @THRobinson You can play with buttons by shorting pins if you have to.

  • 0 Votes
    87 Posts
    36k Views
    Muntic0reM

    try recuva

  • Backup Program for Rpi

    Projects and Themes
    1
    0 Votes
    1 Posts
    983 Views
    No one has replied
  • Backup my retropie error?

    Help and Support
    7
    1 Votes
    7 Posts
    2k Views
    mediamogulM

    @jesterking said in Backup my retropie error?:

    That being said, the best... method of backing up the entire SD card that I could find is in this link

    At the end of the day, making an sd backup externally really is the best, most all-encompassing method. The same advice is given in the official RetoPie documentation as well.

    https://github.com/retropie/retropie-setup/wiki/updating-retropie#making-a-backup-option-1

  • Help making a back up image

    Help and Support
    1
    0 Votes
    1 Posts
    430 Views
    No one has replied
  • Backing up and updating question

    Help and Support
    3
    0 Votes
    3 Posts
    702 Views
    chubstaC

    Thanks very much - doing a full backup isn't a problem, its just nice to know the options! Will continue to do it this way.

  • -1 Votes
    8 Posts
    2k Views
    M

    @edmaul69 what's deleted?