dev/toolbox/backup.sh
2024-01-16 09:54:33 +02:00

12 lines
287 B
Bash
Executable File

#!/bin/bash
DIR=$1
[ $# -lt 1 ] && echo "Directory argument is missing" && exit
[ $# -gt 1 ] && echo "Too many arguments" && exit
[ ! -d $DIR ] && echo "Directory ${DIR} does not exist" && exit
./db -e ${DIR}
tar -cjpf ${DIR}.tar.bz2 ${DIR} ${DIR}.*
ls -l ${DIR}.tar.bz2 --color=auto