Skip to content

Instantly share code, notes, and snippets.

@nimaid
Last active May 2, 2024 13:16
Show Gist options
  • Save nimaid/e904f7776903c4f05d392753ee2e2459 to your computer and use it in GitHub Desktop.
Save nimaid/e904f7776903c4f05d392753ee2e2459 to your computer and use it in GitHub Desktop.
WinSCP + Batch script to automatically backup various Nintendo Switch homebrew folders over FTP
@echo off
for %%x in (
"C:\Games\Switch\SwitchAutoBackup\JKSV\"
"C:\Games\Switch\SwitchAutoBackup\Album"
"C:\Games\Switch\SwitchAutoBackup\forwarders"
"C:\Games\Switch\SwitchAutoBackup\retroarch\roms"
"C:\Games\Switch\SwitchAutoBackup\retroarch\savefiles"
"C:\Games\Switch\SwitchAutoBackup\retroarch\system"
"C:\Games\Switch\SwitchAutoBackup\openrct2\home"
"C:\Games\Switch\SwitchAutoBackup\openrct2\saves"
) do (
if not exist %%x mkdir %%x
)
call "C:\Program Files (x86)\WinSCP\WinSCP.com" -r /script="C:\Games\Switch\SwitchAutoBackup.txt"
echo.
echo Backup tasks completed.
pause
open ftp://user:password@ip.address:port/ -rawsettings ProxyPort=0
synchronize local -delete C:\Games\Switch\SwitchAutoBackup\JKSV /JKSV/
synchronize local -delete C:\Games\Switch\SwitchAutoBackup\Album /emuMMC/RAW1/Nintendo/Album/
synchronize local -delete C:\Games\Switch\SwitchAutoBackup\forwarders /forwarders/
synchronize local -delete C:\Games\Switch\SwitchAutoBackup\retroarch\roms /retroarch/roms
synchronize local -delete C:\Games\Switch\SwitchAutoBackup\retroarch\savefiles /retroarch/cores/savefiles
synchronize local -delete C:\Games\Switch\SwitchAutoBackup\retroarch\system /retroarch/cores/system
synchronize local -delete C:\Games\Switch\SwitchAutoBackup\openrct2\home /switch/openrct2/home
synchronize local -delete C:\Games\Switch\SwitchAutoBackup\openrct2\saves /switch/openrct2/saves
exit

SwitchAutoBackup

WinSCP + Batch script to automatically backup various Nintendo Switch homebrew folders over FTP

Original Reddit Post

Setup

  1. Download and install WinSCP.
  2. Setup either ftpd or sys-ftpd depending on your preference of either running FTPD manually when needed or in the background constantly.
  3. Create a folder on your computer: C:\Games\Switch\SwitchAutoBackup
  4. Save SwitchAutoBackup.bat and SwitchAutoBackup.txt to that new folder.
  5. Edit the first line of SwitchAutoBackup.txt to correctly reflect your Switch's FTP client username, password, IP, and port.
  6. Edit both files to remove any folders you don't use. For example:
    • If you don't use OpenRCT2, remove the openrct2 entries.
    • If you don't use the forwarders folder to store custom NSPs forwarders for your NROs / ROMs, remove the forwarders entries.
    • If you don't use RetroArch, remove the retroarch entries.
  7. Install a cloud sync tool like Google Drive, or otherwise use a built-in tool like Microsoft OneDrive.
  8. Configure your cloud sync tool to automaticaly sync the C:\Games\Switch\SwitchAutoBackup folder.

Making a Backup

  1. Save all data in all games.
  2. (Optional) Edit down video clips and otherwise clean up your gallery to minimize disk space.
  3. Use JKSV to take backups of all your games.
  4. Open FTPD (if using sys-ftpd, skip this step).
  5. Run the SwitchAutoBackup.bat script.
  6. Verify your cloud sync program detects and syncs the changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment