script Beispiele ergänzt

This commit is contained in:
2019-01-07 09:55:04 +01:00
parent 6f9a8f4076
commit ea67258714
3 changed files with 20 additions and 3 deletions

9
beispiele/archive-dir.sh Normal file
View File

@@ -0,0 +1,9 @@
#!/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

View File

@@ -0,0 +1,7 @@
#!/bin/bash
if [ -n $2 ]
grep -r --include="*.$2" "$1" .
else
grep -r "$1" .
fi