remove extra header that apparently is done for me

This commit is contained in:
Christian
2021-03-27 11:57:46 -04:00
parent 08791a346c
commit 820817c957

View File

@@ -2,7 +2,6 @@
layout: post
title: "Automatic SD Card Backer Upper"
---
# Automatic SD Card Backer Upper
I play on my DSi a lot, and i have all of my cartridges dumped to an SD card
so I don't need to carry them with me to switch games. All my saves are stored
@@ -11,7 +10,7 @@ lost. So I used my Raspberry Pi to easily back it up. All I have to do is plug
the card into the Pi, and it copies the files into a new folder and toggles a
light when its done.
## What I used:
# What I used:
* SD Card adapter
* USB mouse that I didn't care about
(any usb device that can light up will work)
@@ -20,12 +19,12 @@ light when its done.
I did this on Ubuntu, but the instructions should work for Raspbian as well.
## Files
# Files
I made a few files for this to work: a udev rule file, a systemd unit, and a
shell script.
### Udev Rule
## Udev Rule
```
# /etc/udev/rules.d/999-automount.rules
ACTION=="add", SUBSYSTEM=="block", ENV{ID_SERIAL_SHORT}=="000000000828", RUN+="/usr/bin/systemctl start DSi.service"
@@ -34,7 +33,7 @@ You'll have to modify the `000000000828` to match the serial of your device,
which you can get by plugging in the device, finding its /dev file, and running
`udevadm info /dev/sdx | grep ID_SERIAL_SHORT`.
### Systemd Service
## Systemd Service
```
# /etc/systemd/system/DSi.service
[Unit]
@@ -48,7 +47,7 @@ with `systemctl enable`, just executed with `systemctl start`, which the udev
rule will do automatically. You'll want to modify the `ExecStart` line to point
to your shell script.
### Shell Script
## Shell Script
```
#!/bin/sh
# /home/ubuntu/autocopy.sh
@@ -85,7 +84,7 @@ The `USBDEV` variable is the path to your USB "light" inside
then `cat` the `idProduct` and `idVendor` files inside each usb device folder
until you find the one that matches your usb device.
## Final Product
# Final Product
What you'll have is something you can plug your SD card into and have a backup
taken automagically. The light turns on when it's copying files, and turns off