#!/bin/bash ############################### # # # spapshot script for btrfs # # # ############################### #.... linke diff betwen actual and last hour, day, week, month and or year #deletet files: NUM #createt fiels: NUM #changed fiels: NUM ... #storage verbrauch snap ... ## settings ## timestamp="./last_snap" logfile="/dev/null" #timestamp: # year=`date +%Y` # month=`date +%m` # week=`date +%V` # day=`date +%d` chmod +x $timestamp function main { . $timestamp ## Month ## [ "$year"=="`date +%Y`" ] || { #btrfs creat snapshot -r / /snap.0 wr_stamp } } function wr_stamp { echo "## timestamp for backsnap ##" > "$timestamp" echo "## `date +%Y-%m-%d_%H-%M` ##" >> "$timestamp" echo >> "$timestamp" echo "year=`date +%Y`" >> "$timestamp" echo "month=`date +%m`" >> "$timestamp" echo "week=`date +%V`" >> "$timestamp" echo "day=`date +%d`" >> "$timestamp" }