Compare commits
No commits in common. "bb2fbcb736588fe67d652e1a699e71e5cfd28d0d" and "9d3fe38e3700e845524e3ff0682f9af1509b84f1" have entirely different histories.
bb2fbcb736
...
9d3fe38e37
12672
script/restauration/bdarbre43.sql
Normal file
12672
script/restauration/bdarbre43.sql
Normal file
File diff suppressed because it is too large
Load Diff
12661
script/restauration/bdarbre45.sql
Normal file
12661
script/restauration/bdarbre45.sql
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,53 +1,26 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
HOST=root@onfarbo43
|
HOST=root@onfarbo43
|
||||||
|
restore () {
|
||||||
usage() {
|
ssh "${HOST}" "mysql -u ap45 -pAzerty1+ bdarbre" < bdarbre43.sql
|
||||||
echo -e "Usage: $0 [-f] <compressed dumpfile>\n\t-f: force mode\n\t-h: this help\n" 1>&2; exit 1; }
|
|
||||||
|
|
||||||
restore() {
|
|
||||||
zcat "${filename}" | ssh "${HOST}" "mysql -u ap43 -pAzerty1+ bdarbre"
|
|
||||||
}
|
}
|
||||||
|
while getopts "f" OPT
|
||||||
|
do
|
||||||
|
case "${OPT}" in
|
||||||
|
f)
|
||||||
|
restore
|
||||||
|
exit 0;
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
confirm() {
|
confirm() {
|
||||||
read -r -n 1 -p "${1:-Confirmer?} [o/n]: " REPLY
|
read -r -n 1 -p "${1:-Confirmer?} [o/n]: " REPLY
|
||||||
case "${REPLY}" in
|
case $REPLY in
|
||||||
[oO]) echo ; restore ;;
|
[oO]) echo ; restore ;;
|
||||||
[nN]) echo ; exit 1 ;;
|
[nN]) echo ; exit 1 ;;
|
||||||
*) printf " \033[31m %s \n\033[0m" "Entrée non valide"
|
*) printf " \033[31m %s \n\033[0m" "Entrée non valide"
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
confirm
|
||||||
|
|
||||||
while getopts "fh" OPT
|
|
||||||
do
|
|
||||||
case "${OPT}" in
|
|
||||||
f)
|
|
||||||
forcemode=1
|
|
||||||
;;
|
|
||||||
|
|
||||||
h)
|
|
||||||
usage
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
shift $((OPTIND-1))
|
|
||||||
|
|
||||||
filename="${1}"
|
|
||||||
|
|
||||||
if [[ -z "${filename}" ]] ; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -r "${filename}" ]] ; then
|
|
||||||
echo "erreur ouverture fichier"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${forcemode}" == 1 ]]; then
|
|
||||||
restore
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
confirm
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,53 +1,26 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
HOST=root@onfarbo45
|
HOST=root@onfarbo45
|
||||||
|
restore () {
|
||||||
usage() {
|
ssh "${HOST}" "mysql -u ap45 -pAzerty1+ bdarbre" < bdarbre45.sql
|
||||||
echo -e "Usage: $0 [-f] <compressed dumpfile>\n\t-f: force mode\n\t-h: this help\n" 1>&2; exit 1; }
|
|
||||||
|
|
||||||
restore() {
|
|
||||||
zcat "${filename}" | ssh "${HOST}" "mysql -u ap45 -pAzerty1+ bdarbre"
|
|
||||||
}
|
}
|
||||||
|
while getopts "f" OPT
|
||||||
confirm() {
|
|
||||||
read -r -n 1 -p "${1:-Confirmer?} [o/n]: " REPLY
|
|
||||||
case "${REPLY}" in
|
|
||||||
[oO]) echo ; restore ;;
|
|
||||||
[nN]) echo ; exit 1 ;;
|
|
||||||
*) printf " \033[31m %s \n\033[0m" "Entrée non valide"
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
while getopts "fh" OPT
|
|
||||||
do
|
do
|
||||||
case "${OPT}" in
|
case "${OPT}" in
|
||||||
f)
|
f)
|
||||||
forcemode=1
|
restore
|
||||||
;;
|
exit 0;
|
||||||
|
|
||||||
h)
|
|
||||||
usage
|
|
||||||
exit 0
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift $((OPTIND-1))
|
|
||||||
|
|
||||||
filename="${1}"
|
confirm() {
|
||||||
|
read -r -n 1 -p "${1:-Confirmer?} [o/n]: " REPLY
|
||||||
|
case $REPLY in
|
||||||
|
[oO]) echo ; restore ;;
|
||||||
|
[nN]) echo ; exit 0 ;;
|
||||||
|
*) printf " \033[31m %s \n\033[0m" "Entrée non valide"
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
confirm
|
||||||
|
|
||||||
if [[ -z "${filename}" ]] ; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -r "${filename}" ]] ; then
|
|
||||||
echo "erreur ouverture fichier"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${forcemode}" == 1 ]]; then
|
|
||||||
restore
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
confirm
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
exit 0
|
exit 0
|
||||||
|
19
script/sauvegarde/php43/ONF/getLesInterventions.php
Normal file
19
script/sauvegarde/php43/ONF/getLesInterventions.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
include_once 'include/chargementClasses.php';
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
$laConnexion = new ConnexionBDD();
|
||||||
|
$sql = 'SELECT * FROM intervention INNER JOIN arbre ON arbre.id = intervention.idArbre;';
|
||||||
|
$reponse = $laConnexion->dbh()->query($sql);
|
||||||
|
|
||||||
|
$output = array("lesInterventions"=>$reponse->fetchAll(PDO::FETCH_ASSOC));
|
||||||
|
|
||||||
|
}catch (Exception $e){
|
||||||
|
|
||||||
|
die('Erreur : '.$e->getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
echo(json_encode($output));
|
45
script/sauvegarde/php43/ONF/include/ConnexionBDD.php
Normal file
45
script/sauvegarde/php43/ONF/include/ConnexionBDD.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ConnexionBDD {
|
||||||
|
|
||||||
|
private $_dbh; // Chaine de connexion
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connexion persistante au serveur
|
||||||
|
* @return \PDO Connexion
|
||||||
|
*/
|
||||||
|
public function __construct(){
|
||||||
|
// Définition des variables de connexion
|
||||||
|
$user = "ap43";
|
||||||
|
$pass = "Azerty1+";
|
||||||
|
$dsn ='mysql:host=localhost;dbname=bdarbre'; //Data Source Name
|
||||||
|
|
||||||
|
// Connexion
|
||||||
|
try {
|
||||||
|
$this->_dbh = new PDO($dsn, $user, $pass, array(PDO::ATTR_PERSISTENT=>true,
|
||||||
|
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'')); // Connexion persistante
|
||||||
|
}
|
||||||
|
catch (PDOException $e) {
|
||||||
|
die("Erreur : " . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** afficherErreurSQL :
|
||||||
|
* Affichage de messages lors l'accès à la bdd avec une requete SQL
|
||||||
|
* @param $message : message a afficher
|
||||||
|
*/
|
||||||
|
function afficherErreurSQL($message, $sql="") {
|
||||||
|
echo $message . "<br />" . $sql . "<br />";
|
||||||
|
$info = $this->_dbh->errorInfo();
|
||||||
|
echo "Code erreur : " . $info[0] . ", Message : " . $info[2];
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
function dbh() {
|
||||||
|
return $this->_dbh;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
spl_autoload_register('chargerClasse');
|
||||||
|
function chargerClasse($classe){
|
||||||
|
|
||||||
|
require "include/".$classe.".php";
|
||||||
|
|
||||||
|
}
|
17
script/sauvegarde/php43/ONF/index.php
Normal file
17
script/sauvegarde/php43/ONF/index.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
To change this license header, choose License Headers in Project Properties.
|
||||||
|
To change this template file, choose Tools | Templates
|
||||||
|
and open the template in the editor.
|
||||||
|
-->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
// put your code here
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,6 @@
|
|||||||
|
copy.src.files=false
|
||||||
|
copy.src.on.open=false
|
||||||
|
copy.src.target=/var/www/PhpProject1
|
||||||
|
index.file=index.php
|
||||||
|
run.as=LOCAL
|
||||||
|
url=http://localhost/PHPProjects/ONF/
|
7
script/sauvegarde/php43/ONF/nbproject/project.properties
Normal file
7
script/sauvegarde/php43/ONF/nbproject/project.properties
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
include.path=${php.global.include.path}
|
||||||
|
php.version=PHP_80
|
||||||
|
source.encoding=UTF-8
|
||||||
|
src.dir=.
|
||||||
|
tags.asp=false
|
||||||
|
tags.short=false
|
||||||
|
web.root=.
|
9
script/sauvegarde/php43/ONF/nbproject/project.xml
Normal file
9
script/sauvegarde/php43/ONF/nbproject/project.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||||
|
<type>org.netbeans.modules.php.project</type>
|
||||||
|
<configuration>
|
||||||
|
<data xmlns="http://www.netbeans.org/ns/php-project/1">
|
||||||
|
<name>ONF</name>
|
||||||
|
</data>
|
||||||
|
</configuration>
|
||||||
|
</project>
|
@ -1,15 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
HOST=root@onfarbo43
|
HOST=root@onfarbo43
|
||||||
DATEJ=$(date +%u)
|
DATEJ=$(date +%u)
|
||||||
DATES=$(date +%W)
|
DATES=(date +%W)
|
||||||
semaineMod=$(("${DATES}" % 4))
|
semaineMod=$(("${DATES}" % 4))
|
||||||
|
|
||||||
ssh "${HOST}" "mysqldump -u ap43 -pAzerty1+ bdarbre | gzip" > /root/sauv/jour/bdarbre43-"${DATEJ}".sql.gz
|
ssh "${HOST}" "mysqldump -u ap43 -pAzerty1+ bdarbre | gzip" > /root/sauv/jour/bdarbre43-"${DATEJ}".sql.gz
|
||||||
|
|
||||||
ssh "${HOST}" "mysqldump -u ap43 -pAzerty1+ bdarbre | gzip" > /root/sauv/semaine/bdarbre43-"${semaineMod}".sql.gz
|
ssh "${HOST}" "mysqldump -u ap43 -pAzerty1+ bdarbre | gzip" > /root/sauv/semaine/bdarbre43-"${semaineMod}".sql.gz
|
||||||
|
|
||||||
scp -r "${HOST}":/var/www/html/PHPProjectsAM/ /root/sauv/php43/AM
|
scp -r "${HOST}":/var/www/html/PHPProjects/ONF /root/sauv/php43
|
||||||
scp -r "${HOST}":/var/www/html/PHPProjectsAS/ /root/sauv/php43/AS
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
HOST=root@onfarbo45
|
HOST=root@onfarbo45
|
||||||
DATEJ=$(date +%u)
|
DATEJ=$(date +%u)
|
||||||
DATES=$(date +%W)
|
DATES=(date +%W)
|
||||||
semaineMod=$(("${DATES}" % 4))
|
semaineMod=$(("${DATES}" % 4))
|
||||||
|
|
||||||
ssh "${HOST}" "mysqldump -u ap45 -pAzerty1+ bdarbre | gzip" > /root/sauv/jour/bdarbre45-"${DATEJ}".sql.gz
|
ssh "${HOST}" "mysqldump -u ap45 -pAzerty1+ bdarbre | gzip" > /root/sauv/jour/bdarbre45-"${DATEJ}".sql.gz
|
||||||
|
BIN
script/sauvegarde/semaine/bdarbre43-0.sql.gz
Normal file
BIN
script/sauvegarde/semaine/bdarbre43-0.sql.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user