When a mirror isn’t a mirror

When I started using jekyll to build my website, I wanted an easy way to upload to my host. I host with my email provider, Fastmail, and they deprecated FTP uploads a while back. They’re a simple static website host, no fancy server-side scripting, so there’s no SSH option either. They do offer WebDAV, so that works fine. rclone can handle WebDAV beautifully, and I’ve been using that for years.

Specifically I use the sync command in rclone because it perfectly mirrors the source (my computer) to the destination (my website). If I make a new page, update a page, or delete a page, all of these changes are reflected in the sync process. This is, to my understanding, a true mirroring process. Any changes I make locally are mirrored to the remote host, including deletions; the entire directory structured is preserved and replicated. This makes sense, that’s what I want, ezpz.

I’ve been doing a LOT of gaming on my 3DS lately, and since it’s softmodded, a lot of that gaming is emulating other systems or playing backed up DS or backed up and/or digitally purchased 3DS games too. Lately things seem like they’re loading a lot slower than they used to, and that’s when I remembered that when I got this particular n3DSXL almost two years ago I repurposed my Wii U’s 32GB SD card because I didn’t have any spares. That is to say, this SD card is old and I started getting real worried about losing my game saves, as well as the art I’ve started to make on my 3DS 1 and photos I take with its camera!

Anyway, there’s a couple things going on here and I cut out hundreds of words that I’m going to try to simplify here: The save data locations vary by emulator. Sometimes they’re next to the game files and sometimes they’re in a directory specific to a standalone emulator. Retroarch stores the saves next to the specific core files. DS games that are being boostrapped (i.e. run in DS mode from the SD card vs. run from a DS game card) store in one directory. 3DS games will save to their game card or on the SD card, but if they’re purchased and installed through the eshop they will always save to the SD card.

Checkpoint can be used to back up the save data of any 3DS game (physical card or installed on SD card; this includes Virtual Console releases) as well as physical DS game cards too, and these backups all live within a Checkpoint directory on the SD card.

Anyway. There’s multiple FTP servers for the 3DS 2, and Checkpoint also runs an FTP server too. Run whichever one you want. As for clients, I like lftp a lot, I dunno why, I just learned it like twenty-five years ago and just still use it now. rclone would work and could be just as easily scripted as lftp I bet, WinSCP 3 too. But I know lftp.

So there’s a pile of directories and I want to preserve their structure from the root of the SD card. lftp has a mirror command! Perfect perfect perfect. So I can just use that and dump them into a backup directory on my computer and then use syncthing to mirror that to my NAS. ezpz.

Anyway!, here’s what predicated the whole post, here’s the point I’ve been working towards for nearly a thousand words that I wrote and scrapped:

Then I noticed something. I cleaned up some of the screenshots on my 3DS and when I ran the lftp script again.. those files were still on my computer. mirror does NOT actually mirror! You have to specifically supply the -e or --delete switches to make it do that.

So to recap:

  • rclone sync mirrors everything including deletions by default
  • lftp mirror does not mirror deletions by default

It’s really weird to call it a “mirror” when it isn’t actually mirroring. This didn’t cause me any problems really, but it is something I will need to keep in mind if my needs change.

Given the age of lftp (1997), this might be a something from the time period that’s just never going to change because it would wreak havoc literally across the world. How many load-bearing systems are out there using lftp mirror this way?

Anyway, thanks for reading. This was just a little something that was bothering me recently as I was writing these backup scripts and I needed to vent somewhere. Like there’s no actual problem, but there is a discrepancy between the name of the action and what action actually takes place.

  1. I’d like to talk about this later in a different post :) 

  2. The New model of the 3DS XL makes it really annoying to pop out the SD card, so that’s why I’m not just plugging the card in to my laptop. But also, my Surface Laptop 7 dropped the sd card reader that my Surface Pro 7 had… ugh 

  3. this might be a weird me-thing, but lftp and rclone are apps you run as commands on the cli so I put those in monospace like I do with all cli commands, whereas WinSCP is a GUI app with an icon you click on. it’s a weird distinction, but 🤷‍♀️Â