publiclab / pi-builder

Developing a reproducible build script system for making Raspberry Pi .img files
MIT License
22 stars 15 forks source link

Copy all images to external USB drive when attached #33

Open jywarren opened 6 years ago

jywarren commented 6 years ago

OR: save files to external USB drive if it exists. Either would be great!

I think maybe the way to do this is:

  1. have an environment variable with the path to save to, like $FILE_SAVE_LOCATION or something
  2. have an event run when a new disk is mounted OR monitor disks (maybe with ls /media/removable/ or wherever they'll show up?) once per second using cron
  3. when a new disk is present, re-assign $FILE_SAVE_LOCATION to be the new removable media.
  4. if yet another disk is inserted, re-assign again to the newest
  5. set installed software like RPi Cam interface (see #13) or image-sequencer to use the location in $FILE_SAVE_LOCATION