Compare commits
2 commits
7ee451668a
...
607e000a11
Author | SHA1 | Date | |
---|---|---|---|
607e000a11 | |||
b4842d9522 |
1 changed files with 39 additions and 0 deletions
|
@ -35,6 +35,44 @@ function backup-firefox() {
|
|||
popd &>/dev/null
|
||||
}
|
||||
|
||||
function backup-vivaldi() {
|
||||
local archive="$1"
|
||||
local target="$2"
|
||||
local hostname
|
||||
local date
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
archive="$(grep -E '^ID=' /etc/os-release | cut -d'=' -f2)$(grep -E '^VERSION_ID=' /etc/os-release | cut -d'=' -f2)"
|
||||
if [[ -z "$archive" ]]; then
|
||||
archive="latest"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "$2" ]]; then
|
||||
if [[ -d "/mnt/storage/psi-jack/Backups" ]]; then
|
||||
target="/mnt/storage/psi-jack/Backups"
|
||||
else
|
||||
target="/home/psi-jack/Backups"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -f "/etc/hostname" ]]; then
|
||||
hostname=$(< /etc/hostname)
|
||||
else
|
||||
hostname=$(hostname)
|
||||
fi
|
||||
|
||||
date=$(date +"%Y-%m-%d")
|
||||
|
||||
mkdir -p "${target}/${archive}/${hostname}"
|
||||
|
||||
pushd "$HOME" &>/dev/null
|
||||
tar -cvvf "${target}/${archive}/${hostname}/${hostname}-${date}_vivaldi.tar" .config/vivaldi
|
||||
zstd --rm -6 "${target}/${archive}/${hostname}/${hostname}-${date}_vivaldi.tar"
|
||||
popd &>/dev/null
|
||||
}
|
||||
|
||||
|
||||
function backup-home() {
|
||||
local archive="$1"
|
||||
local target="$2"
|
||||
|
@ -90,6 +128,7 @@ function backup-home() {
|
|||
--exclude=psi-jack/.steam \
|
||||
--exclude=psi-jack/.var \
|
||||
--exclude=psi-jack/.vscode \
|
||||
--exclude=psi-jack/.wine \
|
||||
-cvvf "${target}/${archive}/${hostname}/${hostname}-${date}_home.tar" \
|
||||
psi-jack
|
||||
zstd --rm -6 "${target}/${archive}/${hostname}/${hostname}-${date}_home.tar"
|
||||
|
|
Loading…
Reference in a new issue