~carloabelli/bin

ed75bb0a269cc1763ad0508fef844fe7d84db07a — Carlo Abelli 29 days ago 4d4214f
Improve backup
1 files changed, 4 insertions(+), 4 deletions(-)

M backup
M backup => backup +4 -4
@@ 11,9 11,9 @@ comm -23 <(pacman -Qqe | sort) <((echo base; pacman -Qqg base-devel) | sort) > "
rsync -ar --delete --progress --files-from="$HOME/.config/backup/config" "$HOME" "$dir/$(basename "$HOME")"

function is_btrfs_subvolume {
    local dir=$1
    local dir="$1"
    [ "$(stat -f --format="%T" "$dir")" == "btrfs" ] || return 1
    inode="$(stat --format="%i" "$dir")"
    local inode="$(stat --format="%i" "$dir")"
    case "$inode" in
        2|256)
            return 0;;


@@ 22,6 22,6 @@ function is_btrfs_subvolume {
    esac
}

if is_btrfs_subvolume "$1"; then
    sudo btrfs subvolume snapshot "$1" "$1_$(date -u -Ins)"
if is_btrfs_subvolume "$dir"; then
    sudo btrfs subvolume snapshot "$dir" "$dir_$(date -u -Ins)"
fi