Skip to content

Instantly share code, notes, and snippets.

@AdamQuixote
Last active December 14, 2022 15:47
Show Gist options
  • Save AdamQuixote/d9c559652fbd688ae2e130f57384d152 to your computer and use it in GitHub Desktop.
Save AdamQuixote/d9c559652fbd688ae2e130f57384d152 to your computer and use it in GitHub Desktop.
Mister save backup script
# Backs up MisTer saves to an external host using SCP, as well as locally for good measure
# Create a special user on the host w/ the specific perms, and use ssh-keygen to generate a key,
# then ssh-copy-id -p <port> -i <key.pub> <user>@<host>
# don't forget to disable the password on the host after copying
# PLEASE NOTE that the mister has an insecure default password which may be re-enabled on update, so be sure to limit perms appropriately
cp -rv /media/fat/saves/* /media/fat/backups/
echo "Files copied to /media/fat/backups"
echo "Now, trying to upload to the backup host with SCP. You may need to accept the host key if this is the first run or anything has changed."
scp -rv -C -i /root/<PRIVATE_SSH_KEY> -P <PORT> /media/fat/saves/* mister@<HOST_IP>:/mnt/shared/media/mister/
echo "Script complete!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment