linuxkurs/beispiele/4/archive-dir.sh

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