Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
floss:config_ubuntu_server_rpi3 [2020/08/03 23:29] – [Installation] villersd | floss:config_ubuntu_server_rpi3 [2024/04/16 09:34] (Version actuelle) – villersd | ||
---|---|---|---|
Ligne 7: | Ligne 7: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * janvier 2024 : The simplest way is to use the [[https:// | ||
+ | * [[https:// | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
* [[: | * [[: | ||
+ | * liens adaptés pour Ubuntu 22.04.3 : | ||
+ | * [[https:// | ||
===== Installation ===== | ===== Installation ===== | ||
Ligne 85: | Ligne 89: | ||
* **sudo a2enmod rewrite** | * **sudo a2enmod rewrite** | ||
* **sudo systemctl restart apache2** | * **sudo systemctl restart apache2** | ||
- | * Paquets additionnels : | + | * Paquets additionnels |
- | * **sudo apt-get install unison** | + | * **sudo apt-get install unison** |
+ | |||
+ | ==== Ajustement de la timezone ==== | ||
+ | * réf : [[https:// | ||
+ | * ls -l / | ||
+ | * timedatectl | ||
+ | * sudo unlink / | ||
+ | * sudo ln -s / | ||
+ | * ls -l / | ||
+ | * timedatectl | ||
==== Installation type sur un serveur LA(M)P : DokuWiki ===== | ==== Installation type sur un serveur LA(M)P : DokuWiki ===== | ||
Ligne 124: | Ligne 137: | ||
* Mentionner dans ce dernier cas l’expéditeur des notifications par courriel du wiki (paramètres avancés) | * Mentionner dans ce dernier cas l’expéditeur des notifications par courriel du wiki (paramètres avancés) | ||
+ | ===== Exploitation ===== | ||
+ | * mises à jour : | ||
+ | * sudo apt-get update | ||
+ | * sudo apt-get upgrade | ||
+ | * sudo apt-get dist-upgrade | ||
+ | * [[https:// | ||
+ | * erreurs disques : enlever la carte mémoire, la placer dans un lecteur de carte microSD sur un autre ordinateur, et tenter la correction via ces deux commandes : | ||
+ | * < | ||
+ | * < | ||
+ | |||
+ | |||
+ | ==== Dispositif USB externe ==== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * une clé USB insérée dans un PC → ligne finale de /etc/mtab : | ||
+ | * /dev/sdg1 / | ||
+ | * la commande "ls -l / | ||
+ | * La même clé USB dans le Raspberry, permettant de détecter la chaîne " | ||
+ | * la commande "ls -l / | ||
+ | * création du point de montage : | ||
+ | * sudo mkdir /media/usb | ||
+ | * propriétaire et droits (ajuster l' | ||
+ | * sudo chown -R pi:pi /media/usb | ||
+ | * test du montage et démontage en mode manuel (ajuster l' | ||
+ | * sudo mount /dev/sda1 /media/usb -o uid=pi, | ||
+ | * cd /media/usb | ||
+ | * ls | ||
+ | * sudo umount /media/usb | ||
+ | * montage récurrent : ajouter une ligne à la fin du fichier /etc/fstab (ajuster l' | ||
+ | * sudo nano /etc/fstab | ||
+ | * UUID=0133-98D2 /media/usb vfat auto, | ||
+ | * redémarrer : sudo reboot | ||
+ | |||
+ | ==== Script de sauvegarde et automatisation via crontab ==== | ||
+ | |||
+ | === Script de sauvegarde === | ||
+ | * → ajuster l' | ||
+ | * Backup sur l' | ||
+ | * Le script bash backup.sh doit être exécutable. Après sa création, il faudra exécuter "chmod +x backup.sh" | ||
+ | * doc : | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * Création d'un lien symbolique : | ||
+ | * ln -s / | ||
+ | |||
+ | <code backup.sh> | ||
+ | #!/bin/bash | ||
+ | THESITE=" | ||
+ | THEDB=" | ||
+ | THEDBUSER=" | ||
+ | THEDBPW=" | ||
+ | THEDATE=`date +%F-%T` | ||
+ | # backup de la base de données NON UTILISÉ | ||
+ | #mysqldump -u $THEDBUSER -p${THEDBPW} $THEDB | gzip > ~/ | ||
+ | # backup des fichiers du site | ||
+ | #tar -czf ~/ | ||
+ | tar -czf / | ||
+ | # éliminer les fichier vieux de plus de 5 jours | ||
+ | find ~/ | ||
+ | find ~/ | ||
+ | </ | ||
+ | |||
+ | Version après élimination d' | ||
+ | |||
+ | <code backup.sh> | ||
+ | #!/bin/sh | ||
+ | THESITE=" | ||
+ | THEDATE=`date +%F-%H%M%S` | ||
+ | # backup des fichiers du site | ||
+ | tar -czf / | ||
+ | </ | ||
+ | |||
+ | Test du backup : | ||
+ | < | ||
+ | ./backup.sh | ||
+ | </ | ||
+ | |||
+ | Part of bash (version >=4.2) script to remove files in a given directory, older than 8 days, but leave files dated the first day of each month : | ||
+ | |||
+ | < | ||
+ | # Set the directory to clean up | ||
+ | DIR=" | ||
+ | |||
+ | # Calculate the cutoff date | ||
+ | CUTOFF=$(date -d "8 days ago" +%s) | ||
+ | |||
+ | # Loop through the files in the directory | ||
+ | for FILE in " | ||
+ | do | ||
+ | # Check if the file is older than 8 days | ||
+ | if [[ -f " | ||
+ | then | ||
+ | # Check if the file's date is the first day of the month | ||
+ | if [[ $(date -r " | ||
+ | then | ||
+ | echo " | ||
+ | else | ||
+ | echo " | ||
+ | rm " | ||
+ | fi | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | </ | ||
+ | |||
+ | Here's how the script works: | ||
+ | - Set the DIR variable to the directory you want to clean up. | ||
+ | - Use the date command to calculate the cutoff date. This will be 8 days ago from today. | ||
+ | - Loop through each file in the directory using a for loop. | ||
+ | - Check if the file is a regular file (-f) and if its modification time is older than the cutoff date. If it is not, then skip to the next file. | ||
+ | - If the file's modification time is older than the cutoff date, check if the file's date is the first day of the month. If it is, then skip to the next file. | ||
+ | - If the file's date is not the first day of the month, then delete the file using the rm command. | ||
+ | |||
+ | Références sur les formats de date : | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | Références sur les scripts de backup | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | |||
+ | ==== Configuration de base du DokuWiki ==== | ||
+ | * Extensions et gestion système | ||
+ | * upgrade plugin | ||