6543
/
backsnap
Archived
1
0
Fork 0
This repository has been archived on 2019-09-20. You can view files and clone it, but cannot push or open issues or pull requests.
backsnap/backsnap/bin/backsnap-list

43 lines
897 B
Bash

#!/bin/bash
###############################
# #
# spapshot script for btrfs #
# #
###############################
## 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"
}