This commit is contained in:
adri 2017-12-13 16:18:41 +01:00
parent 3e47cdaeec
commit ed0934435b
3 changed files with 46 additions and 15 deletions

15
back
View File

@ -1,15 +0,0 @@
#!/bin/bash
CURDate=$(date "+%Y%m%d%H%M")
FileName=$CURDate$DBUSER
DIR="./"
DIRAPACHE="/var/www"
DBHOST="" #--host=
if [ $# -gt 0 ] ; then
DIR=$1
echo "$1"
fi
if [ ! -d $DIR ]; then
mkdir $DIR
echo $DIR
fi

23
backapache Executable file
View 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

23
backhome Executable file
View 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