Typically dd is the go-to for cloning, but as mentioned that may not be the best option. There are a number of utilities that can copy files. rsync will preserve permission, verify, and keep backups. There's always drag and drop...
PS: cloning creates an exact duplicate (obviously). So if your SD card is 1tb, then your image will be 1tb (appx). If you clone, you better have enough storage.
Unless OP's camera uses a propitiatory format for its SD cards dd is the wrong tool. Pretty much every digital camera I've encountered with removable storage uses FAT32.
@OP:
If you're looking for a project it should be reasonably straight forward. Just break it down into steps (connecting hardware, mounting the SD card, detecting a button press, copying files, verifying the copy, etc). But be careful if your intention is to delete immediately on copy especially if the data cannot easily be replaced.
Personally, I just carry more than one SD card (because they can fail as well as fill up) and backup to SSD/HDD at the end of the day when I get back to where I'm staying (or back home if it's local). I use a PC/laptop for that but a cheap android tablet works too as long as it has USB host support.
Python or shell script (bash) could be used but there are things you may not have considered like:
- Dealing with duplicate file and directory names.
- Signalling success and/or failure to the user.
- The Pi not having a battery backed RTC so it won't have the correct date and time.
- Powering the PI including dealing with sudden power loss when the battery runs out. Especially when that happens mid copy (which it will).
- Making your software bullet proof (so you don't end up thinking it has worked correctly when it hasn't and erase data that wasn't backed up)
- USB limitations of the PI (smaller models - A[+] and zero series - only have a single usable USB port).
Statistics: Posted by thagrol — Tue Jan 06, 2026 12:50 am