updated names
This commit is contained in:
parent
fe627df7d8
commit
e874996577
10
btrbk
10
btrbk
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source config.sh
|
||||
source /etc/btrbk.conf
|
||||
startDate=$(date +%s)
|
||||
|
||||
function bkRun {
|
||||
|
@ -19,11 +19,11 @@ function bkRun {
|
|||
btrfs subvolume snapshot -r ${SUBVOLS[$i]} $SNAPDIR$snapName
|
||||
sync
|
||||
fi
|
||||
if [[ -d "$snapLast" && $1 = "daily" ]]; then
|
||||
if [[ -d "$snapLast" && $1 = "incremental" ]]; then
|
||||
btrfs send -p $snapLast $SNAPDIR$snapName | gpg --batch -er $PUBKEY -o - | rclone rcat $RCLONEDIR$month"-incr/"$snapName.pgp
|
||||
else
|
||||
btrfs send $SNAPDIR$snapName | gpg --batch -er $PUBKEY -o - | rclone rcat $RCLONEDIR$month"-full/"$snapName.pgp
|
||||
if [[ $1 = "monthly" ]] && rclone ls $RCLONEDIR$(date -d "$date -1 month" +%Y-%B)-incr; then
|
||||
if [[ $1 = "full" ]] && rclone ls $RCLONEDIR$(date -d "$date -1 month" +%Y-%B)-incr; then
|
||||
rclone delete $RCLONEDIR$(date -d "$date -1 month" +%Y-%B)-incr/
|
||||
if rclone ls $RCLONEDIR$(date -d "$date -2 month" +%Y-%B)-full/; then
|
||||
rclone delete $RCLONEDIR$(date -d "$date -2 month" +%Y-%B)-full/
|
||||
|
@ -40,9 +40,9 @@ function bkRun {
|
|||
|
||||
function testDate {
|
||||
if [ `date +%d` != "01" ]; then
|
||||
bkRun "daily"
|
||||
bkRun "incremental"
|
||||
else
|
||||
bkRun "monthly"
|
||||
bkRun "full"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
instbtrbk() {
|
||||
install btrbk /usr/local/bin/
|
||||
install btrbk.conf /etc/btrbk.conf
|
||||
install -t /etc/systemd/system/ btrbk.service btrbk.timer
|
||||
systemctl daemon-reload
|
||||
}
|
||||
|
||||
instrclone() {
|
||||
|
|
Loading…
Reference in a new issue