create_backup does the obvious using tar and xz. Needs two arguments for what and where. folder_size does the obvious using du.
10 lines
152 B
Bash
Executable File
10 lines
152 B
Bash
Executable File
#!/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
|