2

I have a folder in the pi/home directory with python code. Is there a way to update (replace) these files by using one of the usb ports? I would like to be able to plug in the usb, reboot the pi, if there is a usb drive on boot, copy and replace the files in pi/home folder with the ones on the usb then automatically power back down.

mScientist
  • 107
  • 1
  • 1
  • 6

1 Answers1

1

Yes, you can.

First configure your Raspberry Pi to auto-mount USB Storage Devices (guide here).

Then create a script that checks the folders under /media/ where the mounted USB stick would be. If it finds your scripts, replace the old ones with the new ones.

Configure your script to run at boot by editing your /etc/rc.local (guide here)

GramThanos
  • 481
  • 3
  • 12