diff --git a/.ssh/config b/.ssh/config index 36de662..96ac07d 100644 --- a/.ssh/config +++ b/.ssh/config @@ -1,6 +1,8 @@ -Host rpi +Host rpi rpi.local User pi +Host rg351mp rg351mp.local + User root Host * AddKeysToAgent yes diff --git a/bin/sync-rg351mp b/bin/sync-rg351mp new file mode 100755 index 0000000..5013e1e --- /dev/null +++ b/bin/sync-rg351mp @@ -0,0 +1,35 @@ +#!/usr/bin/env fish + +set -l excludes_file (mktemp) + +printf "\ +homebrew +bios +screenshots +gamedata/dosbox +gamedata/drastic +gamedata/hatari +gamedata/mupen64plussa +gamedata/ppsspp +backup +*.old +.DS_Store +._* +.smbdelete* +" > $excludes_file + +if test ! -e /Volumes/Retro + echo 'Mounting server directory...' + open -g 'smb://guest:@rpi/Data/Retro' + + while true + test -e /Volumes/Retro && break + sleep 1 + end +end + +echo 'Syncing...' +rsync -rz --times --itemize-changes --prune-empty-dirs --stats \ + --exclude-from=$excludes_file \ + 'rg351mp:roms/*' \ + /Volumes/Retro/roms/