Skip to content

Commit

Permalink
command to sync the rg351mp
Browse files Browse the repository at this point in the history
  • Loading branch information
micampe committed Jan 3, 2024
1 parent 8961e59 commit e209c23
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .ssh/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Host rpi
Host rpi rpi.local
User pi

Host rg351mp rg351mp.local
User root

Host *
AddKeysToAgent yes
Expand Down
35 changes: 35 additions & 0 deletions bin/sync-rg351mp
Original file line number Diff line number Diff line change
@@ -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/

0 comments on commit e209c23

Please sign in to comment.