#!/bin/bash

if [ $1 = "backup" ]
then
    backup_name=$(date +"%m-%d")"_hot.tar.gz"
    tar cf - \
        /home/fs/Desktop/work \
        /home/fs/Desktop/a79 \
        /home/fs/.pass \
        /home/fs/.mozilla/ \
        /home/fs/.local/nvim \
        /home/fs/.cache/nvim \
        /home/fs/.cache/nvim \
        /home/fs/.emacs.d \
        /home/fs/.local/DBeaverData | pigz > "/home/fs/backups/$backup_name"
fi

if [ $1 = "restore" ]
then
    tar --use-compress-program=pigz -xf $2 -C /
fi
