From e209c23c652d4f58dfef4b3306151f9ed756edd0 Mon Sep 17 00:00:00 2001 From: Michele Campeotto Date: Sat, 30 Dec 2023 15:56:56 +0100 Subject: [PATCH] command to sync the rg351mp --- .ssh/config | 4 +++- bin/sync-rg351mp | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100755 bin/sync-rg351mp 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/