diff --git a/back b/back deleted file mode 100644 index bf2e325..0000000 --- a/back +++ /dev/null @@ -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 diff --git a/backapache b/backapache new file mode 100755 index 0000000..4800926 --- /dev/null +++ b/backapache @@ -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 diff --git a/backhome b/backhome new file mode 100755 index 0000000..8f0a15d --- /dev/null +++ b/backhome @@ -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