linuxkurs/beispiele/4/archive-dir.sh
2019-01-08 13:08:27 +01:00

10 lines
167 B
Bash

#!/bin/bash
if [ -z "$1" ]; then
echo usage: $0 directory
exit
fi
SRCD=$1
TGTD="/home/$USER/backups/"
OF=home-$(date +%Y%m%d).tgz
tar -czf $TGTD$OF $SRCD