From 1ea0b6abe938248a05abf87ca6f01f88f282cf1d Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 27 Mar 2021 12:01:48 -0400 Subject: [PATCH] yeah more formatting dunno why lower headers are larger --- _posts/2021-03-27-sd-card-backer-upper.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/_posts/2021-03-27-sd-card-backer-upper.md b/_posts/2021-03-27-sd-card-backer-upper.md index 1fd85f0..bb4f878 100644 --- a/_posts/2021-03-27-sd-card-backer-upper.md +++ b/_posts/2021-03-27-sd-card-backer-upper.md @@ -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 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) @@ -19,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" @@ -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 `udevadm info /dev/sdx | grep ID_SERIAL_SHORT`. -## Systemd Service +# Systemd Service ``` # /etc/systemd/system/DSi.service [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 to your shell script. -## Shell Script +# Shell Script ``` #!/bin/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 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