Little helper to sync SD card

Here in this forum I read sometimes about worries of write cycles at flash storage.
Some repository are under more or less heavy development, so I’ve seen 762 MB in …/infrared/Flipperzero-IRDB/ on my Flipper SD Card, the local folder has only 124 MB …

I am trying to dig in every aspect of the flipper, so I have various github sources. Beside the various sources, which are difficult to organize, it is hard to browse all the files on the small screen.

My solution: Last weekend I wrote a little helper, that keeps my SD Card databases in sync with some github repositorys.

You need a bash-like shell with installed git, rsync. If you just run the script, it will clone and/or upgrade the github projects in local ~/git.
If the mountpoint in the variable $sdcard exists, it will sync the local ~/git repositories to the sdcard. It will compare the local files with the SDCard files by checksum, and add/update/remove only the necessary (rsync)

Of course it could be extended, to backup the own flipper dumps to a local directory. It could get parameterized to tell the mountpoint dynamic and sync via udev rule (but be aware, the process takes time).
Maybe in future releases, not as first shot. Next I want to port it to python, to reach more host systems.

Of course the filesize local and remote will be different, because of another filesystem (blocksize).

An overview about the sizes at 26. Jan. 2023:

Size on SD:  247M /media/lupus/BENNIE/infrared/Flipper-IRDB
Local size: 124M /home/lupus/git/Flipper-IRDB

Size on SD:  22M /media/lupus/BENNIE/nfc/FlipperAmiibo
Local size: 8,8M /home/lupus/git/FlipperAmiibo

Size on SD:  121M /media/lupus/BENNIE/subghz/flipperzero-bruteforce
Local size: 115M /home/lupus/git/flipperzero-bruteforce

Size on SD:  4,5M /media/lupus/BENNIE/badusb/UNC0V3R3D
Local size: 1,4M /home/lupus/git/Flipper_Zero-BadUsb

Size on SD:  33M /media/lupus/BENNIE/badusb/I-Am-Jakoby
Local size: 31M /home/lupus/git/Flipper-Zero-BadUSB

Size on SD:  70M /media/lupus/BENNIE/badusb/FalsePhilosopher
Local size: 63M /home/lupus/git/badusb

Size on SD:  8,1M /media/lupus/BENNIE/badusb/hack5_payloads
Local size: 5,4M /home/lupus/git/Flipper_Zero_Badusb_hack5_payloads

Size of dumps: 
2,3M /media/lupus/BENNIE/nfc/guidoz/ 
627M /media/lupus/BENNIE/subghz/guidoz/ 
384K /media/lupus/BENNIE/subplaylist/ 
304K /media/lupus/BENNIE/unirf/ 
2,3M /media/lupus/BENNIE/badusb/guidoz/ 
64K /media/lupus/BENNIE/picopass/ 
632M insgesamt
Size of music:
1,5G /media/lupus/BENNIE/wav_player/ 
363M /media/lupus/BENNIE/music_player/ 
1,8G insgesamt
Local size: 3,5G /home/lupus/git/Flipper

Feel free to comment in or out or add any repository you’d like.

As far as I can see, there is nothing illegal available in the sources.
And keep in mind: Bruteforce is not elegant! It is the last option if nothing clever won’t work.

2 Likes