fin
This commit is contained in:
23
backhome
Executable file
23
backhome
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
CURDate=$(date "+%Y%m%d%H%M")
|
||||
FileName=$CURDate"APACHE"
|
||||
DIR="./"
|
||||
DIRHOME=$HOME
|
||||
|
||||
if [ $# -gt 0 ] ; then
|
||||
DIR=$1
|
||||
fi
|
||||
if [ ! -d $DIR ]; then
|
||||
mkdir $DIR
|
||||
fi
|
||||
if [ ! -d "$DIR" ] || [ ! -x "$DIR" ]; then
|
||||
echo "Vous n'avez pas les droit pour accéder à $DIR"
|
||||
exit -1
|
||||
fi
|
||||
if [ ! -x "$DIRHOME" ]; then
|
||||
echo "Vous n'avez pas les droit pour accéder à $DIRHOME"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
tar -czf "$DIR/$FileName.tar.gz" $DIRHOME
|
||||
Reference in New Issue
Block a user