Skip to content

Instantly share code, notes, and snippets.

View laamaa's full-sized avatar

Jonne Kokkonen laamaa

View GitHub Profile
@laamaa
laamaa / m8-incremental-backup.sh
Created October 2, 2025 16:28
A bash script that creates incremental backups of an SD card on macOS using rsync
#!/bin/bash
#
# Incremental backup script for SD card on macOS with rotation
#
# === CONFIGURATION ===
SDCARD="/Volumes/M8" # Mount point of the SD card
BACKUPDIR="$HOME/Backups/m8-sd-backups" # Where backups are stored
DATE=$(date +%Y-%m-%d-%H%M%S) # Timestamp for snapshot folder
DEST="$BACKUPDIR/backup-$DATE" # New backup folder