yeah more formatting
dunno why lower headers are larger
This commit is contained in:
@@ -10,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
|
the card into the Pi, and it copies the files into a new folder and toggles a
|
||||||
light when its done.
|
light when its done.
|
||||||
|
|
||||||
# What I used:
|
## What I used:
|
||||||
* SD Card adapter
|
* SD Card adapter
|
||||||
* USB mouse that I didn't care about
|
* USB mouse that I didn't care about
|
||||||
(any usb device that can light up will work)
|
(any usb device that can light up will work)
|
||||||
@@ -19,12 +19,12 @@ light when its done.
|
|||||||
|
|
||||||
I did this on Ubuntu, but the instructions should work for Raspbian as well.
|
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
|
I made a few files for this to work: a udev rule file, a systemd unit, and a
|
||||||
shell script.
|
shell script.
|
||||||
|
|
||||||
## Udev Rule
|
# Udev Rule
|
||||||
```
|
```
|
||||||
# /etc/udev/rules.d/999-automount.rules
|
# /etc/udev/rules.d/999-automount.rules
|
||||||
ACTION=="add", SUBSYSTEM=="block", ENV{ID_SERIAL_SHORT}=="000000000828", RUN+="/usr/bin/systemctl start DSi.service"
|
ACTION=="add", SUBSYSTEM=="block", ENV{ID_SERIAL_SHORT}=="000000000828", RUN+="/usr/bin/systemctl start DSi.service"
|
||||||
@@ -33,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
|
which you can get by plugging in the device, finding its /dev file, and running
|
||||||
`udevadm info /dev/sdx | grep ID_SERIAL_SHORT`.
|
`udevadm info /dev/sdx | grep ID_SERIAL_SHORT`.
|
||||||
|
|
||||||
## Systemd Service
|
# Systemd Service
|
||||||
```
|
```
|
||||||
# /etc/systemd/system/DSi.service
|
# /etc/systemd/system/DSi.service
|
||||||
[Unit]
|
[Unit]
|
||||||
@@ -47,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
|
rule will do automatically. You'll want to modify the `ExecStart` line to point
|
||||||
to your shell script.
|
to your shell script.
|
||||||
|
|
||||||
## Shell Script
|
# Shell Script
|
||||||
```
|
```
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# /home/ubuntu/autocopy.sh
|
# /home/ubuntu/autocopy.sh
|
||||||
@@ -84,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
|
then `cat` the `idProduct` and `idVendor` files inside each usb device folder
|
||||||
until you find the one that matches your usb device.
|
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
|
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
|
taken automagically. The light turns on when it's copying files, and turns off
|
||||||
|
|||||||
Reference in New Issue
Block a user