Ajout documentation projets OpenClassrooms (P02-P13) avec support bilingue
- Add all project documentation pages in French and English - Include PDF viewers for presentations and documents (P10, P12) - Add collapsible sections for scripts and logs (P10) - Add static assets for all projects - Update sidebars with new projets-openclassrooms category - Add npm start:en script for testing English locale
This commit is contained in:
parent
40a8985942
commit
ed989ff004
86 changed files with 24243 additions and 1 deletions
18614
static/assets/projets-oc/p02/bene_mael_1_export_122024.sql
Normal file
18614
static/assets/projets-oc/p02/bene_mael_1_export_122024.sql
Normal file
File diff suppressed because one or more lines are too long
BIN
static/assets/projets-oc/p02/bene_mael_3_agent_GLPI_122024.pdf
Normal file
BIN
static/assets/projets-oc/p02/bene_mael_3_agent_GLPI_122024.pdf
Normal file
Binary file not shown.
BIN
static/assets/projets-oc/p02/bene_mael_4_logigramme_122024.pdf
Normal file
BIN
static/assets/projets-oc/p02/bene_mael_4_logigramme_122024.pdf
Normal file
Binary file not shown.
BIN
static/assets/projets-oc/p03/plan_adressagereseau.xlsx
Normal file
BIN
static/assets/projets-oc/p03/plan_adressagereseau.xlsx
Normal file
Binary file not shown.
BIN
static/assets/projets-oc/p03/regles_firewall.xlsx
Normal file
BIN
static/assets/projets-oc/p03/regles_firewall.xlsx
Normal file
Binary file not shown.
BIN
static/assets/projets-oc/p03/schemalogique.jpg
Normal file
BIN
static/assets/projets-oc/p03/schemalogique.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
BIN
static/assets/projets-oc/p03/schemaphysique.jpg
Normal file
BIN
static/assets/projets-oc/p03/schemaphysique.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 146 KiB |
19
static/assets/projets-oc/p04/Dockerfile.txt
Normal file
19
static/assets/projets-oc/p04/Dockerfile.txt
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
FROM php:8.0-apache
|
||||
|
||||
# Mise à jour et installation des dépendances
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libzip-dev \
|
||||
unzip \
|
||||
&& docker-php-ext-install mysqli \
|
||||
&& docker-php-ext-enable mysqli
|
||||
|
||||
# Activer le site beesafe.conf et désactiver le site par défaut 000-default.conf
|
||||
RUN a2ensite beesafe.conf && \
|
||||
a2dissite 000-default.conf && \
|
||||
service apache2 reload
|
||||
|
||||
# Nettoyage des fichiers inutiles pour réduire la taille de l'image
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Commande pour garder Apache en fonctionnement
|
||||
CMD ["apache2-foreground"]
|
||||
53
static/assets/projets-oc/p04/docker-compose.yml
Normal file
53
static/assets/projets-oc/p04/docker-compose.yml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
services:
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: apache_php
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./web:/var/www/html
|
||||
- ./apache/beesafe.conf:/etc/apache2/sites-available/beesafe.conf
|
||||
depends_on:
|
||||
- db
|
||||
- dns
|
||||
networks:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
db:
|
||||
image: mysql:8.0
|
||||
container_name: mysql
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: rootclassroom
|
||||
MYSQL_DATABASE: beesafe_db
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
- ./sql:/docker-entrypoint-initdb.d
|
||||
networks:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
dns:
|
||||
image: internetsystemsconsortium/bind9:9.18
|
||||
container_name: bind9
|
||||
ports:
|
||||
- "53:53/tcp"
|
||||
- "53:53/udp"
|
||||
volumes:
|
||||
- ./bind9/etc:/etc/bind
|
||||
- ./bind9/cache:/var/cache/bind
|
||||
- ./bind9/lib:/var/lib/bind
|
||||
- ./bind9/log:/var/log
|
||||
command: ["-g"]
|
||||
networks:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
backend:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
BIN
static/assets/projets-oc/p04/schema_archi_ntiers.pdf
Normal file
BIN
static/assets/projets-oc/p04/schema_archi_ntiers.pdf
Normal file
Binary file not shown.
Binary file not shown.
38
static/assets/projets-oc/p05/iptables-rules.v4
Normal file
38
static/assets/projets-oc/p05/iptables-rules.v4
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Generated by iptables-save v1.8.10 (nf_tables) on Tue Feb 18 18:27:58 2025
|
||||
*filter
|
||||
:INPUT DROP [0:0]
|
||||
:FORWARD DROP [0:0]
|
||||
:OUTPUT ACCEPT [2:240]
|
||||
-A INPUT -i lo -j ACCEPT
|
||||
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -i ens33 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -i ens34 -p tcp -m tcp --dport 80 -j ACCEPT
|
||||
-A INPUT -i ens34 -p tcp -m tcp --dport 443 -j ACCEPT
|
||||
-A INPUT -i ens35 -p tcp -m tcp --dport 5501 -j ACCEPT
|
||||
-A INPUT -i ens35 -p tcp -m tcp --dport 5502 -j ACCEPT
|
||||
-A INPUT -i ens35 -p tcp -m tcp --dport 22 -j ACCEPT
|
||||
-A INPUT -i ens35 -p tcp -m tcp --dport 21 -j ACCEPT
|
||||
-A INPUT -i ens35 -p tcp -m tcp --dport 10000:10100 -j ACCEPT
|
||||
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
|
||||
-A INPUT -j LOG --log-prefix "IPTables-Dropped: "
|
||||
-A FORWARD -i ens34 -o ens33 -j ACCEPT
|
||||
-A FORWARD -i ens35 -o ens33 -j ACCEPT
|
||||
-A FORWARD -i ens33 -o ens34 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A FORWARD -i ens33 -o ens35 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A OUTPUT -o lo -j ACCEPT
|
||||
-A OUTPUT -o ens33 -j ACCEPT
|
||||
-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
|
||||
-A OUTPUT -p tcp -m tcp --dport 53 -j ACCEPT
|
||||
-A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT
|
||||
-A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT
|
||||
COMMIT
|
||||
# Completed on Tue Feb 18 18:27:58 2025
|
||||
# Generated by iptables-save v1.8.10 (nf_tables) on Tue Feb 18 18:27:58 2025
|
||||
*nat
|
||||
:PREROUTING ACCEPT [0:0]
|
||||
:INPUT ACCEPT [0:0]
|
||||
:OUTPUT ACCEPT [0:0]
|
||||
:POSTROUTING ACCEPT [0:0]
|
||||
-A POSTROUTING -o ens33 -j MASQUERADE
|
||||
COMMIT
|
||||
# Completed on Tue Feb 18 18:27:58 2025
|
||||
33
static/assets/projets-oc/p05/jail.local
Normal file
33
static/assets/projets-oc/p05/jail.local
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
[DEFAULT]
|
||||
backend = auto
|
||||
banaction = iptables-multiport
|
||||
protocol = tcp
|
||||
chain = INPUT
|
||||
action = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
|
||||
[apache-custom]
|
||||
enabled = true
|
||||
port = http,https,5501,5502
|
||||
filter = apache-custom
|
||||
logpath = /var/log/apache2/*_access.log
|
||||
maxretry = 3
|
||||
findtime = 300
|
||||
bantime = 300
|
||||
|
||||
[nginx-custom]
|
||||
enabled = true
|
||||
port = http,https,5501,5502
|
||||
filter = nginx-custom
|
||||
logpath = /var/log/nginx/access.log
|
||||
maxretry = 3
|
||||
findtime = 300
|
||||
bantime = 300
|
||||
|
||||
[vsftpd-custom]
|
||||
enabled = true
|
||||
port = ftp,ftp-data,ftps,ftps-data
|
||||
filter = vsftpd-custom
|
||||
logpath = /var/log/vsftpd.log
|
||||
maxretry = 3
|
||||
findtime = 300
|
||||
bantime = 300
|
||||
32
static/assets/projets-oc/p05/vsftpd.conf
Normal file
32
static/assets/projets-oc/p05/vsftpd.conf
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
listen=YES
|
||||
listen_ipv6=NO
|
||||
|
||||
|
||||
anonymous_enable=NO
|
||||
local_enable=YES
|
||||
write_enable=YES
|
||||
|
||||
|
||||
chroot_local_user=YES
|
||||
|
||||
|
||||
ssl_enable=YES
|
||||
allow_anon_ssl=NO
|
||||
force_local_data_ssl=YES
|
||||
force_local_logins_ssl=YES
|
||||
ssl_tlsv1=YES
|
||||
ssl_sslv2=NO
|
||||
ssl_sslv3=NO
|
||||
rsa_cert_file=/etc/ssl/certs/rainbowbank.com.crt
|
||||
rsa_private_key_file=/etc/ssl/private/rainbowbank.com.key
|
||||
|
||||
|
||||
pasv_enable=YES
|
||||
pasv_min_port=10000
|
||||
pasv_max_port=10100
|
||||
|
||||
log_ftp_protocol=YES
|
||||
xferlog_enable=YES
|
||||
xferlog_std_format=NO
|
||||
xferlog_file=/var/log/vsftpd.log
|
||||
dual_log_enable=YES
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<#
|
||||
.DESCRIPTION
|
||||
Script pour copier les données du disque D vers G:\Mon Drive\projet6
|
||||
.NOTES
|
||||
Date de création : 17/03/2025
|
||||
.AUTEUR
|
||||
BENE Maël
|
||||
.VERSION
|
||||
1.1
|
||||
#>
|
||||
|
||||
# Chemins source et destination
|
||||
$SourcePath = "D:\"
|
||||
$DestinationPath = "G:\Mon Drive\projet6"
|
||||
|
||||
# Copie des fichiers avec Robocopy
|
||||
Write-Host "Copie des données en cours de $SourcePath vers $DestinationPath..." -ForegroundColor Cyan
|
||||
|
||||
try {
|
||||
Robocopy.exe "$SourcePath" "$DestinationPath" /E /COPY:DAT /R:2 /W:5 /MT:8 /XD "System Volume Information" "$RECYCLE.BIN" "Recovery" #Ajout d'exceptions pour les fichiers systèmes
|
||||
|
||||
# Affichage détaillé du résultat
|
||||
switch ($LASTEXITCODE) {
|
||||
0 { Write-Host "Aucun fichier copié - Tous les fichiers étaient déjà synchronisés." -ForegroundColor Green }
|
||||
1 { Write-Host "Fichiers copiés avec succès." -ForegroundColor Green }
|
||||
2 { Write-Host "Fichiers supplémentaires détectés." -ForegroundColor Yellow }
|
||||
4 { Write-Host "Fichiers mal assortis détectés." -ForegroundColor Yellow }
|
||||
8 { Write-Host "Erreurs de copie détectées." -ForegroundColor Red }
|
||||
16 { Write-Host "Erreur grave dans la copie." -ForegroundColor Red }
|
||||
default { Write-Host "Code de sortie Robocopy: $LASTEXITCODE" -ForegroundColor Magenta }
|
||||
}
|
||||
|
||||
} catch {
|
||||
Write-Host "Erreur lors de l'exécution de Robocopy: $_" -ForegroundColor Red
|
||||
}
|
||||
|
||||
Write-Host "Opération terminée." -ForegroundColor Cyan
|
||||
BIN
static/assets/projets-oc/p06/BENE_Mael_gpo_horairesdetravail.png
Normal file
BIN
static/assets/projets-oc/p06/BENE_Mael_gpo_horairesdetravail.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
|
|
@ -0,0 +1,33 @@
|
|||
<#
|
||||
.DESCRIPTION
|
||||
Script pour définir les heures de connexion de 6h à 20h tous les jours de la semaine
|
||||
.NOTES
|
||||
Date de création : 17/03/2025
|
||||
.AUTEUR
|
||||
BENE Maël
|
||||
.VERSION
|
||||
1.0
|
||||
#>
|
||||
|
||||
# Récupération récursive des utilisateurs (inclut les membres des sous-groupes)
|
||||
$users = Get-ADGroupMember -Identity OpenBank -Recursive | Select-Object -ExpandProperty SamAccountName
|
||||
|
||||
# Création du tableau de 21 octets (168 heures dans une semaine)
|
||||
$LogonHours = New-Object byte[] 21
|
||||
|
||||
# Dimanche = index 0, Lundi = index 1, ..., Samedi = index 6
|
||||
# Définition des heures de connexion (6h à 20h) pour tous les jours de la semaine
|
||||
|
||||
for ($day = 0; $day -le 6; $day++) { # Dimanche (0) à Samedi (6)
|
||||
for ($hour = 5; $hour -lt 19; $hour++) { # De 6h à 20h
|
||||
$byteIndex = [math]::Floor(($day * 24 + $hour) / 8)
|
||||
$bitIndex = ($day * 24 + $hour) % 8
|
||||
$LogonHours[$byteIndex] = $LogonHours[$byteIndex] -bor (1 -shl $bitIndex)
|
||||
}
|
||||
}
|
||||
|
||||
# Appliquer la restriction à l'utilisateur
|
||||
foreach ($user in $users)
|
||||
{
|
||||
Set-ADUser -Identity $user -Replace @{logonHours=$LogonHours}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
@echo off
|
||||
REM Vérification de l'utilisateur
|
||||
if "%username%"=="agarcia" (
|
||||
echo Installation de flux-setup.exe pour %username%
|
||||
winget install -e --id flux.flux --silent --accept-package-agreements --accept-source-agreements
|
||||
) else (
|
||||
echo Installation non applicable pour cet utilisateur.
|
||||
exit /b
|
||||
)
|
||||
BIN
static/assets/projets-oc/p06/BENE_Mael_gpo_installflux.png
Normal file
BIN
static/assets/projets-oc/p06/BENE_Mael_gpo_installflux.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
73
static/assets/projets-oc/p06/BENE_Mael_pfsenseNantes.xml
Normal file
73
static/assets/projets-oc/p06/BENE_Mael_pfsenseNantes.xml
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
|
||||
<ipsec>
|
||||
<client></client>
|
||||
<phase1>
|
||||
<ikeid>1</ikeid>
|
||||
<iketype>ikev2</iketype>
|
||||
<interface>opt1</interface>
|
||||
<remote-gateway>194.0.0.1</remote-gateway>
|
||||
<protocol>inet</protocol>
|
||||
<myid_type>address</myid_type>
|
||||
<myid_data>194.0.0.2</myid_data>
|
||||
<peerid_type>address</peerid_type>
|
||||
<peerid_data>194.0.0.1</peerid_data>
|
||||
<encryption>
|
||||
<item>
|
||||
<encryption-algorithm>
|
||||
<name>aes</name>
|
||||
<keylen>256</keylen>
|
||||
</encryption-algorithm>
|
||||
<hash-algorithm>sha256</hash-algorithm>
|
||||
<prf-algorithm>sha256</prf-algorithm>
|
||||
<dhgroup>14</dhgroup>
|
||||
</item>
|
||||
</encryption>
|
||||
<lifetime>28800</lifetime>
|
||||
<rekey_time></rekey_time>
|
||||
<reauth_time></reauth_time>
|
||||
<rand_time></rand_time>
|
||||
<pre-shared-key>bc4b31bbe6ac6eba857a44b8941ed31389cdb6c678635384b676ae34</pre-shared-key>
|
||||
<private-key></private-key>
|
||||
<certref></certref>
|
||||
<pkcs11certref></pkcs11certref>
|
||||
<pkcs11pin></pkcs11pin>
|
||||
<caref></caref>
|
||||
<authentication_method>pre_shared_key</authentication_method>
|
||||
<descr><![CDATA[Tunnel vers Paris]]></descr>
|
||||
<nat_traversal>on</nat_traversal>
|
||||
<mobike>off</mobike>
|
||||
<startaction></startaction>
|
||||
<closeaction></closeaction>
|
||||
<dpd_delay>10</dpd_delay>
|
||||
<dpd_maxfail>5</dpd_maxfail>
|
||||
</phase1>
|
||||
<phase2>
|
||||
<ikeid>1</ikeid>
|
||||
<uniqid>67cf001195fba</uniqid>
|
||||
<mode>tunnel</mode>
|
||||
<reqid>1</reqid>
|
||||
<localid>
|
||||
<type>network</type>
|
||||
<address>10.0.2.0</address>
|
||||
<netbits>24</netbits>
|
||||
</localid>
|
||||
<remoteid>
|
||||
<type>network</type>
|
||||
<address>10.0.1.0</address>
|
||||
<netbits>24</netbits>
|
||||
</remoteid>
|
||||
<protocol>esp</protocol>
|
||||
<encryption-algorithm-option>
|
||||
<name>aes</name>
|
||||
<keylen>256</keylen>
|
||||
</encryption-algorithm-option>
|
||||
<hash-algorithm-option>hmac_sha256</hash-algorithm-option>
|
||||
<pfsgroup>14</pfsgroup>
|
||||
<lifetime>3600</lifetime>
|
||||
<rekey_time></rekey_time>
|
||||
<rand_time></rand_time>
|
||||
<pinghost>10.0.1.1</pinghost>
|
||||
<keepalive>disabled</keepalive>
|
||||
<descr><![CDATA[Trafic LAN Paris-Nantes]]></descr>
|
||||
</phase2>
|
||||
</ipsec>
|
||||
73
static/assets/projets-oc/p06/BENE_Mael_pfsenseParis.xml
Normal file
73
static/assets/projets-oc/p06/BENE_Mael_pfsenseParis.xml
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
|
||||
<ipsec>
|
||||
<client></client>
|
||||
<phase1>
|
||||
<ikeid>1</ikeid>
|
||||
<iketype>ikev2</iketype>
|
||||
<interface>opt1</interface>
|
||||
<remote-gateway>194.0.0.2</remote-gateway>
|
||||
<protocol>inet</protocol>
|
||||
<myid_type>address</myid_type>
|
||||
<myid_data>194.0.0.1</myid_data>
|
||||
<peerid_type>address</peerid_type>
|
||||
<peerid_data>194.0.0.2</peerid_data>
|
||||
<encryption>
|
||||
<item>
|
||||
<encryption-algorithm>
|
||||
<name>aes</name>
|
||||
<keylen>256</keylen>
|
||||
</encryption-algorithm>
|
||||
<hash-algorithm>sha256</hash-algorithm>
|
||||
<prf-algorithm>sha256</prf-algorithm>
|
||||
<dhgroup>14</dhgroup>
|
||||
</item>
|
||||
</encryption>
|
||||
<lifetime>28800</lifetime>
|
||||
<rekey_time></rekey_time>
|
||||
<reauth_time></reauth_time>
|
||||
<rand_time></rand_time>
|
||||
<pre-shared-key>bc4b31bbe6ac6eba857a44b8941ed31389cdb6c678635384b676ae34</pre-shared-key>
|
||||
<private-key></private-key>
|
||||
<certref></certref>
|
||||
<pkcs11certref></pkcs11certref>
|
||||
<pkcs11pin></pkcs11pin>
|
||||
<caref></caref>
|
||||
<authentication_method>pre_shared_key</authentication_method>
|
||||
<descr><![CDATA[Tunnel vers Nantes]]></descr>
|
||||
<nat_traversal>on</nat_traversal>
|
||||
<mobike>off</mobike>
|
||||
<startaction></startaction>
|
||||
<closeaction></closeaction>
|
||||
<dpd_delay>10</dpd_delay>
|
||||
<dpd_maxfail>5</dpd_maxfail>
|
||||
</phase1>
|
||||
<phase2>
|
||||
<ikeid>1</ikeid>
|
||||
<uniqid>67ceff22aa6e4</uniqid>
|
||||
<mode>tunnel</mode>
|
||||
<reqid>1</reqid>
|
||||
<localid>
|
||||
<type>network</type>
|
||||
<address>10.0.1.0</address>
|
||||
<netbits>24</netbits>
|
||||
</localid>
|
||||
<remoteid>
|
||||
<type>network</type>
|
||||
<address>10.0.2.0</address>
|
||||
<netbits>24</netbits>
|
||||
</remoteid>
|
||||
<protocol>esp</protocol>
|
||||
<encryption-algorithm-option>
|
||||
<name>aes</name>
|
||||
<keylen>256</keylen>
|
||||
</encryption-algorithm-option>
|
||||
<hash-algorithm-option>hmac_sha256</hash-algorithm-option>
|
||||
<pfsgroup>14</pfsgroup>
|
||||
<lifetime>3600</lifetime>
|
||||
<rekey_time></rekey_time>
|
||||
<rand_time></rand_time>
|
||||
<pinghost>10.0.2.1</pinghost>
|
||||
<keepalive>disabled</keepalive>
|
||||
<descr><![CDATA[Trafic LAN Paris-Nantes]]></descr>
|
||||
</phase2>
|
||||
</ipsec>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 91 KiB |
Binary file not shown.
BIN
static/assets/projets-oc/p08/BENE_Mael_3_indicateurs_062025.pdf
Normal file
BIN
static/assets/projets-oc/p08/BENE_Mael_3_indicateurs_062025.pdf
Normal file
Binary file not shown.
Binary file not shown.
70
static/assets/projets-oc/p09/MapDrives.ps1
Normal file
70
static/assets/projets-oc/p09/MapDrives.ps1
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# ============================================================================
|
||||
# Script : MapDrives.ps1
|
||||
# Version : 1.1
|
||||
# Date : 29/07/2025
|
||||
# Auteur : BENE Maël
|
||||
# Description: Montage automatique des partages réseau personnels et de groupe
|
||||
# ============================================================================
|
||||
|
||||
# Fonction pour supprimer les accents (normalisation)
|
||||
function Remove-Accents($text) {
|
||||
$normalized = [System.Text.NormalizationForm]::FormD
|
||||
$string = [System.String]::new($text).Normalize($normalized)
|
||||
$sb = New-Object System.Text.StringBuilder
|
||||
foreach ($c in $string.ToCharArray()) {
|
||||
if (-not [Globalization.CharUnicodeInfo]::GetUnicodeCategory($c).ToString().StartsWith("NonSpacingMark")) {
|
||||
[void]$sb.Append($c)
|
||||
}
|
||||
}
|
||||
return $sb.ToString().Normalize([System.Text.NormalizationForm]::FormC)
|
||||
}
|
||||
|
||||
# Table de correspondance sans accents dans les clés
|
||||
$groupShareMap = @{
|
||||
"G_Admins" = "Admins"
|
||||
"G_Audio" = "Audio"
|
||||
"G_Commercial" = "Commercial"
|
||||
"G_Direction" = "Direction"
|
||||
"G_Developpeurs" = "Developpeurs"
|
||||
"G_Graphisme" = "Graphisme"
|
||||
"G_Responsables" = "Responsables"
|
||||
"G_Testeurs" = "Tests"
|
||||
}
|
||||
|
||||
# Récupération de l'utilisateur et des groupes AD
|
||||
$user = $env:USERNAME
|
||||
$userGroupsRaw = ([System.Security.Principal.WindowsIdentity]::GetCurrent()).Groups | ForEach-Object {
|
||||
$_.Translate([System.Security.Principal.NTAccount]).Value.Split('\')[-1]
|
||||
}
|
||||
|
||||
# Normalisation des noms de groupes
|
||||
$userGroups = @()
|
||||
foreach ($grp in $userGroupsRaw) {
|
||||
$grpNorm = Remove-Accents $grp
|
||||
$userGroups += $grpNorm
|
||||
}
|
||||
|
||||
# Montage du partage personnel
|
||||
$homeShare = "\\SRV-AD\$user`$"
|
||||
Write-Host "Tentative de montage : $homeShare"
|
||||
net use * $homeShare /persistent:no
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "Partage personnel monté avec succès."
|
||||
} else {
|
||||
Write-Host "Échec du montage du partage personnel."
|
||||
}
|
||||
|
||||
# Montage des partages de groupe
|
||||
foreach ($group in $userGroups) {
|
||||
if ($groupShareMap.ContainsKey($group)) {
|
||||
$shareName = $groupShareMap[$group]
|
||||
$sharePath = "\\SRV-AD\$shareName"
|
||||
Write-Host "Tentative de montage : $sharePath (via groupe $group)"
|
||||
net use * $sharePath /persistent:no
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "Partage $shareName monté avec succès."
|
||||
} else {
|
||||
Write-Host "Échec du montage de $shareName."
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
static/assets/projets-oc/p09/ansible.zip
Normal file
BIN
static/assets/projets-oc/p09/ansible.zip
Normal file
Binary file not shown.
9
static/assets/projets-oc/p09/groups_glpi.csv
Normal file
9
static/assets/projets-oc/p09/groups_glpi.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
"Nom complet";"Commentaires";
|
||||
"G_Admins";"";
|
||||
"G_Audio";"";
|
||||
"G_Commercial";"";
|
||||
"G_Développeurs";"";
|
||||
"G_Direction";"";
|
||||
"G_Graphisme";"";
|
||||
"G_Responsables";"";
|
||||
"G_Testeurs";"";
|
||||
|
8
static/assets/projets-oc/p09/materiels_reseau_glpi.csv
Normal file
8
static/assets/projets-oc/p09/materiels_reseau_glpi.csv
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"Nom";"Statut";"Fabricant";"Lieu";"Type";"Modèle";"Firmware";"Dernière modification";
|
||||
"BOX-SIT-001";"";"";"";"Box internet";"";"";"2025-07-21 13:25";
|
||||
"FWL-SIT-001";"";"";"";"Firewall";"";"";"2025-07-21 13:25";
|
||||
"SWS-ADM-001";"";"";"";"Switch";"";"";"2025-07-21 13:25";
|
||||
"SWS-DEV-001";"";"";"";"Switch";"";"";"2025-07-21 13:25";
|
||||
"SWS-GPH-001";"";"";"";"Switch";"";"";"2025-07-21 13:25";
|
||||
"SWS-SIT-001";"";"";"";"Switch";"";"";"2025-07-21 13:25";
|
||||
"SWS-TST-001";"";"";"";"Switch";"";"";"2025-07-21 13:25";
|
||||
|
66
static/assets/projets-oc/p09/mount_shares.sh
Normal file
66
static/assets/projets-oc/p09/mount_shares.sh
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
#!/bin/bash
|
||||
|
||||
# ============================================================================
|
||||
# Script : mount_shares.sh
|
||||
# Version : 1.0
|
||||
# Date : 14/07/2025
|
||||
# Auteur : BENE Maël
|
||||
# Description: Montage automatique des partages CIFS personnels et de groupe
|
||||
# ============================================================================
|
||||
|
||||
DOMAIN="BARZINI.INTERNAL"
|
||||
SERVER="SRV-AD"
|
||||
user="$(id -un)"
|
||||
uid="$(id -u)"
|
||||
gid="$(id -g)"
|
||||
groups="$(id -Gn)"
|
||||
|
||||
# Liste fixe des partages de groupe disponibles
|
||||
share_names=("Admins" "Audio" "Commercial" "Direction" "Développeurs" "Graphisme" "Responsables" "Tests")
|
||||
|
||||
# Montage du partage personnel
|
||||
home_share="//${SERVER}/${user}\$"
|
||||
home_mount="${user_home}/Dossier_perso"
|
||||
|
||||
echo "Montage du dossier personnel : $home_share"
|
||||
if [ ! -d "$home_mount" ]; then
|
||||
mkdir -p "$home_mount"
|
||||
chown "$uid:$gid" "$home_mount"
|
||||
fi
|
||||
|
||||
if ! mountpoint -q "$home_mount"; then
|
||||
sudo mount -t cifs -o "sec=krb5,cruid=${user},uid=${uid},gid=${gid},nofail" "$home_share" "$home_mount" && \
|
||||
echo "Partage personnel monté sur $home_mount" || \
|
||||
echo "Échec du montage du partage personnel"
|
||||
else
|
||||
echo "Déjà monté : $home_mount"
|
||||
fi
|
||||
|
||||
# Montage des partages de groupe
|
||||
for share in "${share_names[@]}"; do
|
||||
for grp in $groups; do
|
||||
clean_grp=$(echo "$grp" | tr '[:upper:]' '[:lower:]')
|
||||
clean_share=$(echo "$share" | tr '[:upper:]' '[:lower:]')
|
||||
if [[ "$clean_grp" == *"$clean_share"* ]]; then
|
||||
share_path="//${SERVER}/${share}"
|
||||
mount_point="${user_home}/${share}"
|
||||
|
||||
echo "Tentative de montage de $share_path"
|
||||
|
||||
if [ ! -d "$mount_point" ]; then
|
||||
mkdir -p "$mount_point"
|
||||
chown "$uid:$gid" "$mount_point"
|
||||
fi
|
||||
|
||||
if ! mountpoint -q "$mount_point"; then
|
||||
sudo mount -t cifs -o "sec=krb5,cruid=${user},uid=${uid},gid=${gid},nofail" "$share_path" "$mount_point" && \
|
||||
echo "Partage monté : $mount_point" || \
|
||||
echo "Échec du montage : $share_path"
|
||||
else
|
||||
echo "Déjà monté : $mount_point"
|
||||
fi
|
||||
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
40
static/assets/projets-oc/p09/ordinateurs_glpi.csv
Normal file
40
static/assets/projets-oc/p09/ordinateurs_glpi.csv
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
"Nom";"Statut";"Fabricant";"Numéro de série";"Type";"Modèle";"Système d'exploitation - Nom";"Lieu";"Dernière modification";"Composants - Processeur";
|
||||
"PCX-GPH-001";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PCX-GPH-002";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PCX-GPH-003";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PCX-GPH-003";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PFX-DEV-001";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PFX-DEV-002";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PFX-DEV-003";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PFX-DEV-004";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PFX-DEV-005";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PFX-SIT-001";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PFX-SIT-002";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PFX-SND-001";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PFX-SND-002";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PFX-SND-003";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PFX-TST-001";"";"";"";"Ordinateur de bureau";"";"";"";"2025-07-21 13:16";"";
|
||||
"PPB-ADM-001";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-ADM-002";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-ADM-003";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-ADM-004";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-ADM-005";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-ADM-006";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-DEV-001";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-DEV-002";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-DEV-003";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-DEV-004";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-GPH-001";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-GPH-002";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-GPH-004";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-GPH-005";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-GPH-006";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-GPH-007";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-SND-001";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-SND-002";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-TST-001";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-TST-002";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-TST-003";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"PPB-TST-004";"";"";"";"Ordinateur portable";"";"";"";"2025-07-21 13:18";"";
|
||||
"SRV-INF-001";"";"";"";"Serveur";"";"";"";"2025-07-21 13:16";"";
|
||||
"SRV-INF-002";"";"";"";"Serveur";"";"";"";"2025-07-21 13:16";"";
|
||||
|
BIN
static/assets/projets-oc/p09/rapport_ansible.pdf
Normal file
BIN
static/assets/projets-oc/p09/rapport_ansible.pdf
Normal file
Binary file not shown.
9
static/assets/projets-oc/p09/telephones_glpi.csv
Normal file
9
static/assets/projets-oc/p09/telephones_glpi.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
"Nom";"Statut";"Fabricant";"Lieu";"Type";"Modèle";"Dernière modification";"Usager";
|
||||
"SPA-DEV-001";"";"";"";"Telephone Android";"";"2025-07-21 13:22";"";
|
||||
"SPA-DEV-002";"";"";"";"Telephone Android";"";"2025-07-21 13:22";"";
|
||||
"SPA-DEV-003";"";"";"";"Telephone Android";"";"2025-07-21 13:22";"";
|
||||
"SPA-DEV-004";"";"";"";"Telephone Android";"";"2025-07-21 13:22";"";
|
||||
"SPA-TST-001";"";"";"";"Telephone Android";"";"2025-07-21 13:22";"";
|
||||
"SPI-DEV-001";"";"";"";"Telephone iPhone";"";"2025-07-21 13:22";"";
|
||||
"SPI-DEV-002";"";"";"";"Telephone iPhone";"";"2025-07-21 13:22";"";
|
||||
"SPI-TST-001";"";"";"";"Telephone iPhone";"";"2025-07-21 13:22";"";
|
||||
|
40
static/assets/projets-oc/p09/users_glpi.csv
Normal file
40
static/assets/projets-oc/p09/users_glpi.csv
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
"Identifiant";"Nom de famille";"Courriels";"Téléphone";"Lieu";"Actif";
|
||||
"a.cailot";"Cailot";"";"";"";"Oui";
|
||||
"a.fournier";"Fournier";"";"";"";"Oui";
|
||||
"a.turcotte";"Turcotte";"";"";"";"Oui";
|
||||
"b.aupry";"Aupry";"";"";"";"Oui";
|
||||
"b.banon";"Banon";"";"";"";"Oui";
|
||||
"b.schneider";"Schneider";"";"";"";"Oui";
|
||||
"c.caron";"Caron";"";"";"";"Oui";
|
||||
"c.desaulniers";"Desaulniers";"";"";"";"Oui";
|
||||
"c.seguin";"Séguin";"";"";"";"Oui";
|
||||
"d.descoteaux";"Descoteaux";"";"";"";"Oui";
|
||||
"d.fluet";"Fluet";"";"";"";"Oui";
|
||||
"d.ramos";"Ramos";"";"";"";"Oui";
|
||||
"e.dupy";"Dupy";"";"";"";"Oui";
|
||||
"e.navarro";"Navarro";"";"";"";"Oui";
|
||||
"f.gaulin";"Gaulin";"";"";"";"Oui";
|
||||
"f.lang";"Lang";"";"";"";"Oui";
|
||||
"f.paquette";"Paquette";"";"";"";"Oui";
|
||||
"g.favreau";"Favreau";"";"";"";"Oui";
|
||||
"g.langelier";"Langelier";"";"";"";"Oui";
|
||||
"glpi-system";"Support";"";"";"";"Oui";
|
||||
"h.gamelin";"Gamelin";"";"";"";"Oui";
|
||||
"i.herve";"Hervé";"";"";"";"Oui";
|
||||
"j.baron";"Baron";"";"";"";"Oui";
|
||||
"j.champagne";"Champagne";"";"";"";"Oui";
|
||||
"j.daigneault";"Daigneault";"";"";"";"Oui";
|
||||
"l.laurent";"Laurent";"";"";"";"Oui";
|
||||
"m.allard";"Allard";"";"";"";"Oui";
|
||||
"m.anoux";"Anoux";"";"";"";"Oui";
|
||||
"m.bene";"Bene";"";"";"";"Oui";
|
||||
"m.lazure";"Lazure";"";"";"";"Oui";
|
||||
"m.monjeau";"Monjeau";"";"";"";"Oui";
|
||||
"n.roux";"Roux";"";"";"";"Oui";
|
||||
"o.couturier";"Couturier";"";"";"";"Oui";
|
||||
"p.marcoux";"Marcoux";"";"";"";"Oui";
|
||||
"p.poirierdebuisson";"Poirier de Buisson";"";"";"";"Oui";
|
||||
"r.ruiz";"Ruiz";"";"";"";"Oui";
|
||||
"v.arcouet";"Arcouet";"";"";"";"Oui";
|
||||
"v.gougeon";"Gougeon";"";"";"";"Oui";
|
||||
"v.jacob";"Jacob";"";"";"";"Oui";
|
||||
|
Binary file not shown.
15
static/assets/projets-oc/p10/logs/restores_dif.log
Normal file
15
static/assets/projets-oc/p10/logs/restores_dif.log
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
=====================================================
|
||||
[2025-08-12 17:29:42] ➤ DÉBUT DE LA RESTAURATION DIFFÉRENTIELLE
|
||||
Dossier restauré : MACHINES
|
||||
Destination locale : /home/oclassroom/mairie/MACHINES
|
||||
Source distante : backup-user@stockage:/home/backup-user/backup/MACHINES
|
||||
=====================================================
|
||||
receiving incremental file list
|
||||
./
|
||||
fichier_1Go.bin
|
||||
fichier_gros.test
|
||||
|
||||
sent 65 bytes received 6.444.024.019 bytes 186.783.306,78 bytes/sec
|
||||
total size is 6.442.450.944 speedup is 1,00
|
||||
[2025-08-12 17:30:16] ➤ FIN DE LA RESTAURATION
|
||||
|
||||
52
static/assets/projets-oc/p10/logs/restores_inc.log
Normal file
52
static/assets/projets-oc/p10/logs/restores_inc.log
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
=====================================================
|
||||
[2025-08-12 17:23:56] ➤ DÉBUT DE LA RESTAURATION INCRÉMENTALE
|
||||
Dossier restauré : FICHIERS
|
||||
Type : Fichier spécifique
|
||||
Horodatage de la sauvegarde : 2025-08-25_12-00-00_INC
|
||||
=====================================================
|
||||
➤ Restauration de 'doc1.txt' vers '/home/oclassroom/mairie/FICHIERS/.'
|
||||
receiving incremental file list
|
||||
doc1.txt
|
||||
|
||||
sent 43 bytes received 139 bytes 121,33 bytes/sec
|
||||
total size is 18 speedup is 0,10
|
||||
=====================================================
|
||||
[2025-08-12 17:24:13] ➤ DÉBUT DE LA RESTAURATION INCRÉMENTALE
|
||||
Dossier restauré : FICHIERS
|
||||
Type : Dossier complet
|
||||
Horodatage de la sauvegarde : 2025-08-25_12-00-00_INC
|
||||
=====================================================
|
||||
receiving incremental file list
|
||||
./
|
||||
doc2.txt
|
||||
fichier_2025-08-12_1.txt
|
||||
fichier_2025-08-12_2.txt
|
||||
fichier_2025-08-13_1.txt
|
||||
fichier_2025-08-13_2.txt
|
||||
fichier_2025-08-14_1.txt
|
||||
fichier_2025-08-14_2.txt
|
||||
fichier_2025-08-15_1.txt
|
||||
fichier_2025-08-15_2.txt
|
||||
fichier_2025-08-16_1.txt
|
||||
fichier_2025-08-16_2.txt
|
||||
fichier_2025-08-17_1.txt
|
||||
fichier_2025-08-17_2.txt
|
||||
fichier_2025-08-18_1.txt
|
||||
fichier_2025-08-18_2.txt
|
||||
fichier_2025-08-19_1.txt
|
||||
fichier_2025-08-19_2.txt
|
||||
fichier_2025-08-20_1.txt
|
||||
fichier_2025-08-20_2.txt
|
||||
fichier_2025-08-21_1.txt
|
||||
fichier_2025-08-21_2.txt
|
||||
fichier_2025-08-22_1.txt
|
||||
fichier_2025-08-22_2.txt
|
||||
fichier_2025-08-23_1.txt
|
||||
fichier_2025-08-23_2.txt
|
||||
fichier_2025-08-24_1.txt
|
||||
fichier_2025-08-24_2.txt
|
||||
fichier_2025-08-25_1.txt
|
||||
fichier_2025-08-25_2.txt
|
||||
|
||||
sent 578 bytes received 2.750 bytes 6.656,00 bytes/sec
|
||||
total size is 862 speedup is 0,26
|
||||
72
static/assets/projets-oc/p10/logs/sauvegardes_dif.log
Normal file
72
static/assets/projets-oc/p10/logs/sauvegardes_dif.log
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
=====================================================
|
||||
[2025-08-12 17:26:10] ➤ DÉBUT DE LA SAUVEGARDE DIFFÉRENTIELLE
|
||||
Dossier : MACHINES
|
||||
Source : /home/oclassroom/mairie/MACHINES
|
||||
Destination : backup-user@stockage:/home/backup-user/backup/MACHINES
|
||||
Horodatage : 2025-08-12_17-26-10
|
||||
=====================================================
|
||||
[2025-08-12 17:26:10] ➤ Vérification du dossier distant...
|
||||
[2025-08-12 17:26:10] ➤ Dossier distant prêt.
|
||||
[2025-08-12 17:26:10] ➤ Lancement de rsync...
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_gros.test
|
||||
rsync error: unexplained error (code 255) at rsync.c(716) [sender=3.2.7]
|
||||
[2025-08-12 17:26:35] ➤ Durée de la sauvegarde : 25 secondes
|
||||
=====================================================
|
||||
[2025-08-12 17:26:42] ➤ DÉBUT DE LA SAUVEGARDE DIFFÉRENTIELLE
|
||||
Dossier : MACHINES
|
||||
Source : /home/oclassroom/mairie/MACHINES
|
||||
Destination : backup-user@stockage:/home/backup-user/backup/MACHINES
|
||||
Horodatage : 2025-08-12_17-26-42
|
||||
=====================================================
|
||||
[2025-08-12 17:26:42] ➤ Vérification du dossier distant...
|
||||
[2025-08-12 17:26:42] ➤ Dossier distant prêt.
|
||||
[2025-08-12 17:26:42] ➤ Lancement de rsync...
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_gros.test
|
||||
|
||||
sent 668.597.769 bytes received 38 bytes 148.577.290,44 bytes/sec
|
||||
total size is 5.368.709.120 speedup is 8,03
|
||||
[2025-08-12 17:26:46] SAUVEGARDE DIFFÉRENTIELLE TERMINÉE
|
||||
|
||||
[2025-08-12 17:26:46] ➤ Durée de la sauvegarde : 4 secondes
|
||||
=====================================================
|
||||
[2025-08-12 17:27:13] ➤ DÉBUT DE LA SAUVEGARDE DIFFÉRENTIELLE
|
||||
Dossier : MACHINES
|
||||
Source : /home/oclassroom/mairie/MACHINES
|
||||
Destination : backup-user@stockage:/home/backup-user/backup/MACHINES
|
||||
Horodatage : 2025-08-12_17-27-13
|
||||
=====================================================
|
||||
[2025-08-12 17:27:13] ➤ Vérification du dossier distant...
|
||||
[2025-08-12 17:27:13] ➤ Dossier distant prêt.
|
||||
[2025-08-12 17:27:13] ➤ Lancement de rsync...
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_gros.test
|
||||
|
||||
sent 5.370.019.985 bytes received 38 bytes 188.421.755,19 bytes/sec
|
||||
total size is 5.368.709.120 speedup is 1,00
|
||||
[2025-08-12 17:27:41] SAUVEGARDE DIFFÉRENTIELLE TERMINÉE
|
||||
|
||||
[2025-08-12 17:27:41] ➤ Durée de la sauvegarde : 28 secondes
|
||||
=====================================================
|
||||
[2025-08-12 17:28:56] ➤ DÉBUT DE LA SAUVEGARDE DIFFÉRENTIELLE
|
||||
Dossier : MACHINES
|
||||
Source : /home/oclassroom/mairie/MACHINES
|
||||
Destination : backup-user@stockage:/home/backup-user/backup/MACHINES
|
||||
Horodatage : 2025-08-12_17-28-56
|
||||
=====================================================
|
||||
[2025-08-12 17:28:56] ➤ Vérification du dossier distant...
|
||||
[2025-08-12 17:28:56] ➤ Dossier distant prêt.
|
||||
[2025-08-12 17:28:56] ➤ Lancement de rsync...
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_1Go.bin
|
||||
|
||||
sent 1.074.004.134 bytes received 38 bytes 165.231.411,08 bytes/sec
|
||||
total size is 6.442.450.944 speedup is 6,00
|
||||
[2025-08-12 17:29:02] SAUVEGARDE DIFFÉRENTIELLE TERMINÉE
|
||||
|
||||
[2025-08-12 17:29:02] ➤ Durée de la sauvegarde : 6 secondes
|
||||
348
static/assets/projets-oc/p10/logs/sauvegardes_inc.log
Normal file
348
static/assets/projets-oc/p10/logs/sauvegardes_inc.log
Normal file
|
|
@ -0,0 +1,348 @@
|
|||
=====================================================
|
||||
[2025-08-12 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-12_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-12 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-12 12:00:00] ➤ Aucune FULL récente trouvée → SAUVEGARDE DE TYPE : FULL
|
||||
sending incremental file list
|
||||
./
|
||||
doc1.txt
|
||||
doc2.txt
|
||||
fichier_2025-08-12_1.txt
|
||||
fichier_2025-08-12_2.txt
|
||||
|
||||
sent 449 bytes received 95 bytes 1.088,00 bytes/sec
|
||||
total size is 94 speedup is 0,17
|
||||
[2025-08-12 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-12 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-13 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-13_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-13 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-13 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-12_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-13_1.txt
|
||||
fichier_2025-08-13_2.txt
|
||||
|
||||
sent 361 bytes received 57 bytes 836,00 bytes/sec
|
||||
total size is 154 speedup is 0,37
|
||||
[2025-08-13 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-13 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-14 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-14_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-14 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-14 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-12_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-13_1.txt
|
||||
fichier_2025-08-13_2.txt
|
||||
fichier_2025-08-14_1.txt
|
||||
fichier_2025-08-14_2.txt
|
||||
|
||||
sent 541 bytes received 95 bytes 1.272,00 bytes/sec
|
||||
total size is 212 speedup is 0,33
|
||||
[2025-08-14 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-14 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-15 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-15_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-15 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-15 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-12_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-13_1.txt
|
||||
fichier_2025-08-13_2.txt
|
||||
fichier_2025-08-14_1.txt
|
||||
fichier_2025-08-14_2.txt
|
||||
fichier_2025-08-15_1.txt
|
||||
fichier_2025-08-15_2.txt
|
||||
|
||||
sent 720 bytes received 133 bytes 1.706,00 bytes/sec
|
||||
total size is 271 speedup is 0,32
|
||||
[2025-08-15 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-15 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-16 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-16_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-16 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-16 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-12_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-13_1.txt
|
||||
fichier_2025-08-13_2.txt
|
||||
fichier_2025-08-14_1.txt
|
||||
fichier_2025-08-14_2.txt
|
||||
fichier_2025-08-15_1.txt
|
||||
fichier_2025-08-15_2.txt
|
||||
fichier_2025-08-16_1.txt
|
||||
fichier_2025-08-16_2.txt
|
||||
|
||||
sent 903 bytes received 171 bytes 2.148,00 bytes/sec
|
||||
total size is 331 speedup is 0,31
|
||||
[2025-08-16 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-16 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-17 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-17_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-17 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-17 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-12_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-13_1.txt
|
||||
fichier_2025-08-13_2.txt
|
||||
fichier_2025-08-14_1.txt
|
||||
fichier_2025-08-14_2.txt
|
||||
fichier_2025-08-15_1.txt
|
||||
fichier_2025-08-15_2.txt
|
||||
fichier_2025-08-16_1.txt
|
||||
fichier_2025-08-16_2.txt
|
||||
fichier_2025-08-17_1.txt
|
||||
fichier_2025-08-17_2.txt
|
||||
|
||||
sent 1.079 bytes received 209 bytes 2.576,00 bytes/sec
|
||||
total size is 390 speedup is 0,30
|
||||
[2025-08-17 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-17 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-18 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-18_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-18 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-18 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-12_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-13_1.txt
|
||||
fichier_2025-08-13_2.txt
|
||||
fichier_2025-08-14_1.txt
|
||||
fichier_2025-08-14_2.txt
|
||||
fichier_2025-08-15_1.txt
|
||||
fichier_2025-08-15_2.txt
|
||||
fichier_2025-08-16_1.txt
|
||||
fichier_2025-08-16_2.txt
|
||||
fichier_2025-08-17_1.txt
|
||||
fichier_2025-08-17_2.txt
|
||||
fichier_2025-08-18_1.txt
|
||||
fichier_2025-08-18_2.txt
|
||||
|
||||
sent 1.284 bytes received 247 bytes 3.062,00 bytes/sec
|
||||
total size is 450 speedup is 0,29
|
||||
[2025-08-18 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-18 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-19 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-19_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-19 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-19 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-12_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-13_1.txt
|
||||
fichier_2025-08-13_2.txt
|
||||
fichier_2025-08-14_1.txt
|
||||
fichier_2025-08-14_2.txt
|
||||
fichier_2025-08-15_1.txt
|
||||
fichier_2025-08-15_2.txt
|
||||
fichier_2025-08-16_1.txt
|
||||
fichier_2025-08-16_2.txt
|
||||
fichier_2025-08-17_1.txt
|
||||
fichier_2025-08-17_2.txt
|
||||
fichier_2025-08-18_1.txt
|
||||
fichier_2025-08-18_2.txt
|
||||
fichier_2025-08-19_1.txt
|
||||
fichier_2025-08-19_2.txt
|
||||
|
||||
sent 1.461 bytes received 285 bytes 3.492,00 bytes/sec
|
||||
total size is 510 speedup is 0,29
|
||||
[2025-08-19 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-19 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-20 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-20_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-20 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-20 12:00:00] ➤ Aucune FULL récente trouvée → SAUVEGARDE DE TYPE : FULL
|
||||
sending incremental file list
|
||||
./
|
||||
doc1.txt
|
||||
doc2.txt
|
||||
fichier_2025-08-12_1.txt
|
||||
fichier_2025-08-12_2.txt
|
||||
fichier_2025-08-13_1.txt
|
||||
fichier_2025-08-13_2.txt
|
||||
fichier_2025-08-14_1.txt
|
||||
fichier_2025-08-14_2.txt
|
||||
fichier_2025-08-15_1.txt
|
||||
fichier_2025-08-15_2.txt
|
||||
fichier_2025-08-16_1.txt
|
||||
fichier_2025-08-16_2.txt
|
||||
fichier_2025-08-17_1.txt
|
||||
fichier_2025-08-17_2.txt
|
||||
fichier_2025-08-18_1.txt
|
||||
fichier_2025-08-18_2.txt
|
||||
fichier_2025-08-19_1.txt
|
||||
fichier_2025-08-19_2.txt
|
||||
fichier_2025-08-20_1.txt
|
||||
fichier_2025-08-20_2.txt
|
||||
|
||||
sent 1.913 bytes received 399 bytes 4.624,00 bytes/sec
|
||||
total size is 570 speedup is 0,25
|
||||
[2025-08-20 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-20 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-21 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-21_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-21 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-21 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-20_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-21_1.txt
|
||||
fichier_2025-08-21_2.txt
|
||||
|
||||
sent 665 bytes received 57 bytes 1.444,00 bytes/sec
|
||||
total size is 630 speedup is 0,87
|
||||
[2025-08-21 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-21 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-22 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-22_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-22 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-22 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-20_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-21_1.txt
|
||||
fichier_2025-08-21_2.txt
|
||||
fichier_2025-08-22_1.txt
|
||||
fichier_2025-08-22_2.txt
|
||||
|
||||
sent 845 bytes received 95 bytes 1.880,00 bytes/sec
|
||||
total size is 689 speedup is 0,73
|
||||
[2025-08-22 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-22 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-23 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-23_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-23 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-23 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-20_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-21_1.txt
|
||||
fichier_2025-08-21_2.txt
|
||||
fichier_2025-08-22_1.txt
|
||||
fichier_2025-08-22_2.txt
|
||||
fichier_2025-08-23_1.txt
|
||||
fichier_2025-08-23_2.txt
|
||||
|
||||
sent 1.023 bytes received 133 bytes 2.312,00 bytes/sec
|
||||
total size is 745 speedup is 0,64
|
||||
[2025-08-23 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-23 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-24 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-24_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-24 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-24 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-20_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-21_1.txt
|
||||
fichier_2025-08-21_2.txt
|
||||
fichier_2025-08-22_1.txt
|
||||
fichier_2025-08-22_2.txt
|
||||
fichier_2025-08-23_1.txt
|
||||
fichier_2025-08-23_2.txt
|
||||
fichier_2025-08-24_1.txt
|
||||
fichier_2025-08-24_2.txt
|
||||
|
||||
sent 1.203 bytes received 171 bytes 2.748,00 bytes/sec
|
||||
total size is 803 speedup is 0,58
|
||||
[2025-08-24 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-24 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
=====================================================
|
||||
[2025-08-25 12:00:00] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE
|
||||
Dossiers sauvegardés : FICHIERS
|
||||
Rétention prévue : 7 jour(s)
|
||||
Horodatage de départ : 2025-08-25_12-00-00
|
||||
=====================================================
|
||||
-----------------------------------------------------
|
||||
[2025-08-25 12:00:00] ➤ Traitement du dossier : FICHIERS
|
||||
[2025-08-25 12:00:00] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : /home/backup-user/backup/FICHIERS/2025-08-20_12-00-00_FULL)
|
||||
sending incremental file list
|
||||
./
|
||||
fichier_2025-08-21_1.txt
|
||||
fichier_2025-08-21_2.txt
|
||||
fichier_2025-08-22_1.txt
|
||||
fichier_2025-08-22_2.txt
|
||||
fichier_2025-08-23_1.txt
|
||||
fichier_2025-08-23_2.txt
|
||||
fichier_2025-08-24_1.txt
|
||||
fichier_2025-08-24_2.txt
|
||||
fichier_2025-08-25_1.txt
|
||||
fichier_2025-08-25_2.txt
|
||||
|
||||
sent 1.384 bytes received 209 bytes 3.186,00 bytes/sec
|
||||
total size is 862 speedup is 0,54
|
||||
[2025-08-25 12:00:01] ➤ Fin de la sauvegarde de FICHIERS
|
||||
[2025-08-25 12:00:01] SAUVEGARDE JOURNALIÈRE TERMINÉE
|
||||
|
||||
11
static/assets/projets-oc/p10/scripts/crontab.txt
Normal file
11
static/assets/projets-oc/p10/scripts/crontab.txt
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Sauvegarde differentielle de la VM qui force l'arret apres 3h (donc a 4h du matin)
|
||||
0 1 * * * timeout 3h /home/oclassroom/backup_script/backup/differentielle.sh
|
||||
|
||||
# Sauvegardes journalieres avec 7 jours de retention
|
||||
0 4 * * * /home/oclassroom/backup_script/backup/incrementale.sh "FICHIERS" 7
|
||||
0 5 * * * /home/oclassroom/backup_script/backup/incrementale.sh "MAILS" 7
|
||||
0 6 * * * /home/oclassroom/backup_script/backup/incrementale.sh "RH" 7
|
||||
30 6 * * * /home/oclassroom/backup_script/backup/incrementale.sh "TICKETS" 7
|
||||
|
||||
# Sauvegarde de SITE tous les 3 jours à 7h, avec 15 jours de retention
|
||||
0 7 */3 * * /home/oclassroom/backup_script/backup/incrementale.sh "SITE" 15
|
||||
36
static/assets/projets-oc/p10/scripts/restore_dif.sh
Normal file
36
static/assets/projets-oc/p10/scripts/restore_dif.sh
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
# Auteur : BENE Maël
|
||||
# Version : 1.1
|
||||
# Description : Restauration manuelle de sauvegarde différentielle (VMs) avec journalisation cumulative
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Configuration
|
||||
DOSSIER="MACHINES"
|
||||
DEST_USER="backup-user"
|
||||
DEST_HOST="stockage"
|
||||
DEST_PATH="/home/$DEST_USER/backup/$DOSSIER"
|
||||
RESTORE_DIR="$HOME/mairie/$DOSSIER"
|
||||
LOG_FILE="$HOME/backup-logs/restores_dif.log"
|
||||
|
||||
mkdir -p "$HOME/backup-logs"
|
||||
mkdir -p "$RESTORE_DIR"
|
||||
|
||||
START_DATE=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
|
||||
{
|
||||
echo "====================================================="
|
||||
echo "[$START_DATE] ➤ DÉBUT DE LA RESTAURATION DIFFÉRENTIELLE"
|
||||
echo "Dossier restauré : $DOSSIER"
|
||||
echo "Destination locale : $RESTORE_DIR"
|
||||
echo "Source distante : $DEST_USER@$DEST_HOST:$DEST_PATH"
|
||||
echo "====================================================="
|
||||
} >> "$LOG_FILE"
|
||||
|
||||
# Restauration avec rsync (différentielle)
|
||||
rsync -av -e ssh "$DEST_USER@$DEST_HOST:$DEST_PATH/" "$RESTORE_DIR/" >> "$LOG_FILE" 2>&1
|
||||
|
||||
{
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ➤ FIN DE LA RESTAURATION"
|
||||
echo
|
||||
} >> "$LOG_FILE"
|
||||
125
static/assets/projets-oc/p10/scripts/restore_inc.sh
Normal file
125
static/assets/projets-oc/p10/scripts/restore_inc.sh
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
#!/bin/bash
|
||||
# Auteur : BENE Maël
|
||||
# Version : 1.1
|
||||
# Description : Restauration interactive d’un dossier ou d’un fichier individuel (version améliorée avec journalisation)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Configuration
|
||||
DEST_USER="backup-user"
|
||||
DEST_HOST="stockage"
|
||||
DEST_BASE="/home/$DEST_USER/backup"
|
||||
BASE_RESTORE_DIR="/home/oclassroom/mairie"
|
||||
LOG_FILE="/home/oclassroom/backup-logs/restores_inc.log"
|
||||
|
||||
# Fonction de log
|
||||
log_header() {
|
||||
local type="$1" # "Dossier complet" ou "Fichier spécifique"
|
||||
{
|
||||
echo "====================================================="
|
||||
echo "[$START_DATE] ➤ DÉBUT DE LA RESTAURATION INCRÉMENTALE"
|
||||
echo "Dossier restauré : $DOSSIER"
|
||||
echo "Type : $type"
|
||||
echo "Horodatage de la sauvegarde : $BACKUP_TIMESTAMP"
|
||||
echo "====================================================="
|
||||
} >> "$LOG_FILE"
|
||||
}
|
||||
|
||||
# Liste des dossiers disponibles (hors MACHINES)
|
||||
DIR_LIST=$(ssh "$DEST_USER@$DEST_HOST" "ls -1 $DEST_BASE" | grep -v '^MACHINES$')
|
||||
if [ -z "$DIR_LIST" ]; then
|
||||
echo "Aucun dossier de sauvegarde trouvé."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Dossiers disponibles à la restauration :"
|
||||
DIR_ARRAY=()
|
||||
i=1
|
||||
while read -r line; do
|
||||
echo " $i) $line"
|
||||
DIR_ARRAY+=("$line")
|
||||
((i++))
|
||||
done <<< "$DIR_LIST"
|
||||
|
||||
read -rp "Numéro du dossier à restaurer : " DIR_NUM
|
||||
DOSSIER="${DIR_ARRAY[$((DIR_NUM - 1))]}"
|
||||
|
||||
# Liste des sauvegardes disponibles
|
||||
BACKUP_LIST=$(ssh "$DEST_USER@$DEST_HOST" "ls -1dt $DEST_BASE/$DOSSIER/20*_* 2>/dev/null")
|
||||
|
||||
if [ -z "$BACKUP_LIST" ]; then
|
||||
echo "Aucune sauvegarde trouvée pour $DOSSIER."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Sauvegardes disponibles pour '$DOSSIER' :"
|
||||
BACKUP_ARRAY=()
|
||||
i=1
|
||||
while read -r line; do
|
||||
SHORT=$(echo "$line" | sed "s|$DEST_BASE/||")
|
||||
echo " $i) $SHORT"
|
||||
BACKUP_ARRAY+=("$line")
|
||||
((i++))
|
||||
done <<< "$BACKUP_LIST"
|
||||
|
||||
read -rp "Numéro de la sauvegarde à restaurer (Entrée = latest) : " BACKUP_NUM
|
||||
if [ -z "$BACKUP_NUM" ]; then
|
||||
SELECTED_BACKUP=$(ssh "$DEST_USER@$DEST_HOST" "readlink -f '$DEST_BASE/$DOSSIER/latest'" || true)
|
||||
if [ -z "$SELECTED_BACKUP" ]; then
|
||||
echo "Aucun lien 'latest' trouvé pour ce dossier."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
SELECTED_BACKUP="${BACKUP_ARRAY[$((BACKUP_NUM - 1))]}"
|
||||
fi
|
||||
|
||||
echo "Sauvegarde sélectionnée : $(echo "$SELECTED_BACKUP" | sed "s|$DEST_BASE/||")"
|
||||
|
||||
# Horodatage pour les logs
|
||||
START_DATE=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
BACKUP_TIMESTAMP=$(basename "$SELECTED_BACKUP")
|
||||
|
||||
# Choix entre restauration complète ou fichier spécifique
|
||||
echo "Que voulez-vous restaurer ?"
|
||||
select CHOIX in "Dossier complet" "Fichier spécifique"; do
|
||||
case $REPLY in
|
||||
1)
|
||||
RESTORE_PATH="$BASE_RESTORE_DIR/$DOSSIER"
|
||||
echo "➤ Restauration complète dans : $RESTORE_PATH"
|
||||
mkdir -p "$RESTORE_PATH"
|
||||
log_header "Dossier complet"
|
||||
rsync -av -e ssh "$DEST_USER@$DEST_HOST:$SELECTED_BACKUP/" "$RESTORE_PATH/" >> "$LOG_FILE" 2>&1
|
||||
echo "Dossier restauré avec succès."
|
||||
break
|
||||
;;
|
||||
2)
|
||||
echo "Liste des fichiers disponibles :"
|
||||
FILE_LIST=$(ssh "$DEST_USER@$DEST_HOST" "cd '$SELECTED_BACKUP' && find . -type f" | sed 's|^\./||')
|
||||
if [ -z "$FILE_LIST" ]; then
|
||||
echo "Aucun fichier trouvé dans la sauvegarde."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FILE_ARRAY=()
|
||||
i=1
|
||||
while read -r file; do
|
||||
echo " $i) $file"
|
||||
FILE_ARRAY+=("$file")
|
||||
((i++))
|
||||
done <<< "$FILE_LIST"
|
||||
|
||||
read -rp "Numéro du fichier à restaurer : " FILE_NUM
|
||||
FILE_TO_RESTORE="${FILE_ARRAY[$((FILE_NUM - 1))]}"
|
||||
DEST_PATH="$BASE_RESTORE_DIR/$DOSSIER/$(dirname "$FILE_TO_RESTORE")"
|
||||
mkdir -p "$DEST_PATH"
|
||||
log_header "Fichier spécifique"
|
||||
echo "➤ Restauration de '$FILE_TO_RESTORE' vers '$DEST_PATH'" >> "$LOG_FILE"
|
||||
rsync -av -e ssh "$DEST_USER@$DEST_HOST:$SELECTED_BACKUP/$FILE_TO_RESTORE" "$DEST_PATH/" >> "$LOG_FILE" 2>&1
|
||||
echo "Fichier restauré avec succès."
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Choix invalide."
|
||||
;;
|
||||
esac
|
||||
done
|
||||
61
static/assets/projets-oc/p10/scripts/sauvegarde_dif.sh
Normal file
61
static/assets/projets-oc/p10/scripts/sauvegarde_dif.sh
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
#!/bin/bash
|
||||
# Auteur : BENE Maël
|
||||
# Version : 1.1
|
||||
# Description : Sauvegarde différentielle avec temps d'execution dans les logs
|
||||
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Configuration
|
||||
DOSSIER="MACHINES"
|
||||
SOURCE_DIR="$HOME/mairie/$DOSSIER"
|
||||
DEST_USER="backup-user"
|
||||
DEST_HOST="stockage"
|
||||
DEST_PATH="/home/$DEST_USER/backup/$DOSSIER"
|
||||
LOG_DIR="$HOME/backup-logs"
|
||||
DATE="$(date '+%Y-%m-%d_%H-%M-%S')"
|
||||
CUMULATIVE_LOG="$LOG_DIR/sauvegardes_dif.log"
|
||||
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
||||
start=0
|
||||
rsync_started=false
|
||||
|
||||
# Fonction exécutée même en cas de plantage ou d'interruption
|
||||
on_exit() {
|
||||
if $rsync_started; then
|
||||
local end=$(date +%s)
|
||||
local duration=$((end - start))
|
||||
echo "[$(date '+%F %T')] ➤ Durée de la sauvegarde : ${duration} secondes" >> "$CUMULATIVE_LOG"
|
||||
fi
|
||||
}
|
||||
trap on_exit EXIT
|
||||
|
||||
# Log de début
|
||||
{
|
||||
echo "====================================================="
|
||||
echo "[$(date '+%F %T')] ➤ DÉBUT DE LA SAUVEGARDE DIFFÉRENTIELLE"
|
||||
echo "Dossier : $DOSSIER"
|
||||
echo "Source : $SOURCE_DIR"
|
||||
echo "Destination : $DEST_USER@$DEST_HOST:$DEST_PATH"
|
||||
echo "Horodatage : $DATE"
|
||||
echo "====================================================="
|
||||
} >> "$CUMULATIVE_LOG"
|
||||
|
||||
# Préparation du dossier distant
|
||||
echo "[$(date '+%F %T')] ➤ Vérification du dossier distant..." >> "$CUMULATIVE_LOG"
|
||||
ssh "$DEST_USER@$DEST_HOST" "mkdir -p '$DEST_PATH'" >> "$CUMULATIVE_LOG" 2>&1
|
||||
echo "[$(date '+%F %T')] ➤ Dossier distant prêt." >> "$CUMULATIVE_LOG"
|
||||
|
||||
# Mesure du temps
|
||||
start=$(date +%s)
|
||||
rsync_started=true
|
||||
|
||||
# Lancement de rsync
|
||||
echo "[$(date '+%F %T')] ➤ Lancement de rsync..." >> "$CUMULATIVE_LOG"
|
||||
rsync -av --inplace --partial --append -e ssh "$SOURCE_DIR/" "$DEST_USER@$DEST_HOST:$DEST_PATH/" \
|
||||
>> "$CUMULATIVE_LOG" 2>&1
|
||||
|
||||
# Si rsync a terminé normalement, on continue le log
|
||||
echo "[$(date '+%F %T')] SAUVEGARDE DIFFÉRENTIELLE TERMINÉE" >> "$CUMULATIVE_LOG"
|
||||
echo >> "$CUMULATIVE_LOG"
|
||||
95
static/assets/projets-oc/p10/scripts/sauvegarde_inc.sh
Normal file
95
static/assets/projets-oc/p10/scripts/sauvegarde_inc.sh
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
#!/bin/bash
|
||||
# Auteur : BENE Maël
|
||||
# Version : 1.2
|
||||
# Description : Sauvegarde incrémentale avec rotation, lien latest, et gestion automatique des FULL via le nom du dossier
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Vérifie les paramètres
|
||||
if [ "$#" -lt 2 ]; then
|
||||
echo "Usage : $0 \"DOSSIER1 DOSSIER2 ...\" NOMBRE_JOURS_DE_RÉTENTION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Paramètres
|
||||
DOSSIERS="$1"
|
||||
RETENTION_JOURS="$2"
|
||||
|
||||
# Configuration
|
||||
SOURCE_DIR="$HOME/mairie"
|
||||
DEST_USER="backup-user"
|
||||
DEST_HOST="stockage"
|
||||
DEST_BASE="/home/$DEST_USER/backup"
|
||||
LOG_DIR="$HOME/backup-logs"
|
||||
DATE="$(date '+%Y-%m-%d_%H-%M-%S')"
|
||||
CUMULATIVE_LOG="$LOG_DIR/sauvegardes_inc.log"
|
||||
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
||||
# En-tête log
|
||||
{
|
||||
echo "====================================================="
|
||||
echo "[$(date '+%F %T')] ➤ DÉBUT DE LA SAUVEGARDE INCRÉMENTALE"
|
||||
echo "Dossiers sauvegardés : $DOSSIERS"
|
||||
echo "Rétention prévue : $RETENTION_JOURS jour(s)"
|
||||
echo "Horodatage de départ : $DATE"
|
||||
echo "====================================================="
|
||||
} >> "$CUMULATIVE_LOG"
|
||||
|
||||
# Vérification de la connexion SSH
|
||||
if ! ssh -q "$DEST_USER@$DEST_HOST" exit; then
|
||||
echo "Erreur : impossible de se connecter à $DEST_USER@$DEST_HOST"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
for dossier in $DOSSIERS; do
|
||||
echo "-----------------------------------------------------" >> "$CUMULATIVE_LOG"
|
||||
echo "[$(date '+%F %T')] ➤ Traitement du dossier : $dossier" >> "$CUMULATIVE_LOG"
|
||||
|
||||
# Détection de la dernière FULL dans la période de rétention
|
||||
LAST_FULL=$(ssh "$DEST_USER@$DEST_HOST" "find '$DEST_BASE/$dossier' -maxdepth 1 -type d -name '*_FULL' -mtime -$RETENTION_JOURS 2>/dev/null" | sort -r | head -n 1)
|
||||
|
||||
FORCE_FULL=0
|
||||
TYPE_SUFFIX=""
|
||||
|
||||
if [ -z "$LAST_FULL" ]; then
|
||||
FORCE_FULL=1
|
||||
TYPE_SUFFIX="_FULL"
|
||||
echo "[$(date '+%F %T')] ➤ Aucune FULL récente trouvée → SAUVEGARDE DE TYPE : FULL" >> "$CUMULATIVE_LOG"
|
||||
else
|
||||
TYPE_SUFFIX="_INC"
|
||||
echo "[$(date '+%F %T')] ➤ Sauvegarde de TYPE : INCRÉMENTALE (base : $LAST_FULL)" >> "$CUMULATIVE_LOG"
|
||||
fi
|
||||
|
||||
BACKUP_ID="${DATE}${TYPE_SUFFIX}"
|
||||
DEST_PATH="$DEST_BASE/$dossier/$BACKUP_ID"
|
||||
|
||||
# Créer le dossier de destination
|
||||
ssh "$DEST_USER@$DEST_HOST" "mkdir -p '$DEST_PATH'" >> "$CUMULATIVE_LOG" 2>&1
|
||||
|
||||
# rsync avec ou sans link-dest
|
||||
if [ "$FORCE_FULL" -eq 1 ]; then
|
||||
rsync -av --delete -e ssh "$SOURCE_DIR/$dossier/" "$DEST_USER@$DEST_HOST:$DEST_PATH/" \
|
||||
>> "$CUMULATIVE_LOG" 2>&1
|
||||
else
|
||||
rsync -av --delete --link-dest="$LAST_FULL" -e ssh "$SOURCE_DIR/$dossier/" "$DEST_USER@$DEST_HOST:$DEST_PATH/" \
|
||||
>> "$CUMULATIVE_LOG" 2>&1
|
||||
fi
|
||||
|
||||
echo "[$(date '+%F %T')] ➤ Fin de la sauvegarde de $dossier" >> "$CUMULATIVE_LOG"
|
||||
|
||||
# Mettre à jour le lien symbolique latest
|
||||
ssh "$DEST_USER@$DEST_HOST" bash -c "'
|
||||
cd \"$DEST_BASE/$dossier\"
|
||||
ln -sfn \"$BACKUP_ID\" latest
|
||||
'" >> "$CUMULATIVE_LOG" 2>&1
|
||||
|
||||
# Rotation : conserver les $RETENTION_JOURS plus récentes (tous types confondus)
|
||||
ssh "$DEST_USER@$DEST_HOST" bash -c "'
|
||||
cd \"$DEST_BASE/$dossier\"
|
||||
ls -1dt 20* | tail -n +$((RETENTION_JOURS + 1)) | xargs -r rm -rf
|
||||
'" >> "$CUMULATIVE_LOG" 2>&1
|
||||
done
|
||||
|
||||
echo "[$(date '+%F %T')] SAUVEGARDE JOURNALIÈRE TERMINÉE" >> "$CUMULATIVE_LOG"
|
||||
echo >> "$CUMULATIVE_LOG"
|
||||
BIN
static/assets/projets-oc/p11/BENE_Mael_1_cartographie_092025.pdf
Normal file
BIN
static/assets/projets-oc/p11/BENE_Mael_1_cartographie_092025.pdf
Normal file
Binary file not shown.
BIN
static/assets/projets-oc/p11/BENE_Mael_2_plan_projet_092025.pdf
Normal file
BIN
static/assets/projets-oc/p11/BENE_Mael_2_plan_projet_092025.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
static/assets/projets-oc/p12/BENE_Mael_2_plan_action_102025.pdf
Normal file
BIN
static/assets/projets-oc/p12/BENE_Mael_2_plan_action_102025.pdf
Normal file
Binary file not shown.
BIN
static/assets/projets-oc/p12/BENE_Mael_3_restitution_102025.pdf
Normal file
BIN
static/assets/projets-oc/p12/BENE_Mael_3_restitution_102025.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
static/assets/projets-oc/p13/bene_mael_3_diaporama_112025.pdf
Normal file
BIN
static/assets/projets-oc/p13/bene_mael_3_diaporama_112025.pdf
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue