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