harder
copies soft media, like CDs and DVDs, to your hard drive.
Goals:
- minimal user input
- autodetect cd/dvd changes
- prioritize expediency and resiliency over disk space efficiency
harder --destination
System configuration:
Install harder
, and find out where your system Python put it:
which harder
> /usr/local/bin/harder
Using this page as a starting point:
cd /etc/udev/rules.d
We need to create a new file in this folder that runs before the others:
sudo vim 10-harder.rules
Insert the following text:
KERNEL=="sr[0-9]", ACTION=="change", ENV{ID_CDROM_MEDIA_CD}=="1", RUN+="/usr/local/bin/harder --type cd --destination /backups/harder"
KERNEL=="sr[0-9]", ACTION=="change", ENV{ID_CDROM_MEDIA_TRACK_COUNT_AUDIO}=="1", RUN+="/usr/local/bin/harder --type cda --destination /backups/harder"
KERNEL=="sr[0-9]", ACTION=="change", ENV{ID_CDROM_MEDIA_DVD}=="1", RUN+="/usr/local/bin/harder --type dvd --destination /backups/harder"
It seems the following ENV{ID_CDROM_???}
boolean variables will be available:
ID_CDROM_MEDIA_BD
: Blu-rayID_CDROM_MEDIA_DVD
: DVDID_CDROM_MEDIA_CD
: CDID_CDROM_MEDIA_TRACK_COUNT_AUDIO
: AUDIO CD
http://salt.readthedocs.org/en/latest/ref/states/all/salt.states.supervisord.html http://salt.readthedocs.org/en/latest/ref/modules/all/salt.modules.supervisord.html
From github:
git clone https://github.com/chbrown/harder.git
cd harder
python setup.py develop
Import:
import harder
Copyright © 2014 Christopher Brown. MIT Licensed.