Skip to content

Instantly share code, notes, and snippets.

@eloo
eloo / raspberry-pi-backup.sh
Last active September 9, 2017 15:55 — forked from eusonlito/raspberry-pi-backup.sh
Create Raspberry Pi backups using a script launched as a cronjob
#!/bin/bash
# Cron installation:
# 30 05 * * 0 /root/scripts/raspberry-pi-backup.sh >> /var/log/backup.log 2>&1
# Configuration
external="/mnt/backup" # Check if external storage is mounted
folder="$external/raspi" # Base backup folder
dev="/dev/mmcblk0" # Device to backup
days=60 # Delete backups older than X days