#!/bin/bash

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

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


# restore
# tar --use-compress-program=pigz -xf archive.tar.gz -C /
