Safe Place for User Scripts

User scripts are likely to be used increasingly as batteries, smart meters, EV chargers, etc become more widely used. Users will want to input data from those devices to emoncms and Emonhub Interfacers are unlikely to be available for most/many of those devices.

Where should user scripts be placed so that they are not over-written by periodic updates?

And could that location be included in the Export/Import routine that’s used when there’s a major image upgrade?

Yes that’s a good idea. I keep having to remember to copy my scripts across, I usually store them in /home/pi.

If you are upgrading via a new SD card (or old SD card re-used but new emonSD image) and using the USB import method, its possible to mount the SD card and copy scripts directly, e.g:

sudo mount -r /dev/sda2 /media/old_sd_root
cp -r /media/old_sd_root/home/pi/my_scripts/. /home/pi/my_scripts