Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paulfantom/media-autocopier
Automatically copy pictures and videos from SD cards to local disk
https://github.com/paulfantom/media-autocopier
Last synced: 4 days ago
JSON representation
Automatically copy pictures and videos from SD cards to local disk
- Host: GitHub
- URL: https://github.com/paulfantom/media-autocopier
- Owner: paulfantom
- License: mit
- Created: 2018-09-09T20:23:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-23T00:31:36.000Z (almost 5 years ago)
- Last Synced: 2024-11-01T09:29:20.211Z (about 2 months ago)
- Language: Shell
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SD Card automatic media copier
Automatically copy pictures after inserting SD Card.
## How this works?
1. Udev detects inserted SD Card with rule from [udev/99-sd-copier.rules] file and notifies systemd service
2. Systemd runs `copier.sh` script with device as parameter. For example if SD card is located at `/dev/sda` then systemd
service state can be checked with `systemctl status [email protected]`
3. `copier.sh` mounts SD card device and tries to detect following parameters from EXIF data of first located picture:
- camera make (manufacturer)
- month and year when picture was taken (if not present it assumes current date)
- picture location (if not present it defaults to `Unknown_Location`)
4. Script uses `rsync` to copy pictures to local directory specified as: `PREFIX/YEAR/MONTH/LOCATION/MANUFACTURER`.
High quality RAW pictures are copied to subfolder called `RAW`. `PREFIX` is set by default to `/srv/media` and can be
changed by modifying systemd service file.## Installation
1. Copy udev rule to `/etc/udev/rules.d` and systemd service to `/etc/systemd/system`
2. Reload udev and system by running following as root: `udevadm control --reload-rules && systemctl daemon-reload`
3. Copy `copier.sh` to `/usr/local/bin` and make sure it is executable.TL;DR:
```
# as root:
cp udev/99-sd-copier.rules /etc/udev/rules.d/
cp systemd/[email protected] /etc/systemd/system/
udevadm control --reload-rules
systemctl daemon-reload
cp copier.sh /usr/local/bin/
chmod +x /usr/local/bin/copier.sh
```## TODO
- rewrite to go-lang?
- containerize?