diff --git a/apacheStop b/apacheStop index f63a9fd..b9676a1 100755 --- a/apacheStop +++ b/apacheStop @@ -4,5 +4,5 @@ if (( $EUID != 0 )); then exit fi SERVICEtoSTOP="apache2" -echo "Démarage d'$SERVICEtoSTOP" -service "$SERVICEtoSTOP" stop \ No newline at end of file +echo "Arret d'$SERVICEtoSTOP" +service "$SERVICEtoSTOP" stop diff --git a/backhome b/backhome index 8f0a15d..4eadca8 100755 --- a/backhome +++ b/backhome @@ -1,7 +1,7 @@ #!/bin/bash CURDate=$(date "+%Y%m%d%H%M") -FileName=$CURDate"APACHE" +FileName=$CURDate"HOME" DIR="./" DIRHOME=$HOME diff --git a/mysqlStop b/mysqlStop index cd49487..b7d1381 100755 --- a/mysqlStop +++ b/mysqlStop @@ -4,5 +4,5 @@ if (( $EUID != 0 )); then exit fi SERVICEtoSTOP="mysql" -echo "Démarage d'$SERVICEtoSTOP" -service "$SERVICEtoSTOP" stop \ No newline at end of file +echo "Arret d'$SERVICEtoSTOP" +service "$SERVICEtoSTOP" stop diff --git a/serveur b/serveur index 28d6b9e..e1fc082 100755 --- a/serveur +++ b/serveur @@ -1,12 +1,11 @@ #!/bin/bash -LOGPATH="./serveur.log" -( -echo "DEBUT $(date +"%D %T")" +LOGPATH="/var/log/serveur.log" if (( $EUID != 0 )); then - echo "Il faut les droit root pour executer la tache" - echo "FIN $(date +"%D %T")" + echo "$(date +"%D %T") : ERREUR : Il faut les droit root pour executer la tache" exit 1 fi +( +echo "DEBUT $(date +"%D %T")" if [[ $# == 3 && $1 == @(apache2|mysql) && $2 == @(apache2|mysql) ]]; then # if [ "$3" = "reload" ] then echo "reload n'est pas une opéopération permise par mysql @@ -48,4 +47,4 @@ elif [[ $1 == @(apache2|mysql) && $2 == @(start|stop|reload) ]]; then esac fi echo "FIN $(date +"%D %T")" -) 2>&2 | tee -a $LOGPATH +) 2>&1 | tee -a $LOGPATH diff --git a/serveur.log b/serveur.log index 690759b..970584a 100644 --- a/serveur.log +++ b/serveur.log @@ -31,3 +31,27 @@ reload n'est pas une opéopération permise par mysql Le service mysql à bien redémarer Le service apache à bien été recharger FIN 12/13/17 11:37:04 +DEBUT 12/14/17 13:33:20 +apache2 mysql sont start +FIN 12/14/17 13:33:22 +DEBUT 12/14/17 13:33:35 +apache2 mysql sont stop +FIN 12/14/17 13:33:37 +DEBUT 12/14/17 13:34:15 +SUCCESS : apache2 start +FIN 12/14/17 13:34:15 +DEBUT 12/14/17 13:34:22 +SUCCESS : apache2 stop +FIN 12/14/17 13:34:22 +DEBUT 12/14/17 13:34:30 +SUCCESS : mysql stop +FIN 12/14/17 13:34:30 +DEBUT 12/14/17 13:34:38 +SUCCESS : mysql start +FIN 12/14/17 13:34:39 +DEBUT 12/14/17 13:34:48 +SUCCESS : mysql stop +FIN 12/14/17 13:34:51 +DEBUT 12/14/17 13:34:55 +SUCCESS : mysql stop +FIN 12/14/17 13:34:55