aboutsummaryrefslogtreecommitdiff
path: root/Scripts/.local/scripts/create_backup
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-09-22 14:54:21 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-09-22 14:54:21 +0100
commita00480771ac3b3ea6f5115524aca612d96341a0f (patch)
treebb228a0bb9db9710021c1bfe668f62799f7858c5 /Scripts/.local/scripts/create_backup
parent2bd582e419e502795f35d858375304b842ba09e4 (diff)
downloaddotfiles-a00480771ac3b3ea6f5115524aca612d96341a0f.tar.gz
dotfiles-a00480771ac3b3ea6f5115524aca612d96341a0f.tar.bz2
dotfiles-a00480771ac3b3ea6f5115524aca612d96341a0f.zip
(Scripts)+create_backup,+folder_size
create_backup does the obvious using tar and xz. Needs two arguments for what and where. folder_size does the obvious using du.
Diffstat (limited to 'Scripts/.local/scripts/create_backup')
-rwxr-xr-xScripts/.local/scripts/create_backup9
1 files changed, 9 insertions, 0 deletions
diff --git a/Scripts/.local/scripts/create_backup b/Scripts/.local/scripts/create_backup
new file mode 100755
index 0000000..cde5a03
--- /dev/null
+++ b/Scripts/.local/scripts/create_backup
@@ -0,0 +1,9 @@
+#!/usr/bin/env sh
+
+set -xe
+
+dir=$2/backup
+arch=$2/archive
+name="$(date +%F)-$(date +%T)-$(basename $1).tar.xz"
+
+XZ_OPT='-T0 -9' tar -Jcvf $dir/$name $1