14-11-2023

This commit is contained in:
2023-11-14 20:35:51 +01:00
parent 5b45dc0863
commit d78f93eed2
93 changed files with 8181 additions and 538 deletions

View File

@@ -110,6 +110,16 @@ service mysql restart || service mariadb restart || service mysqld restart
#### Redémarrer PHP:
```bash
# sous root:
plesk bin php_handler --list | grep -E plesk.*fpm | awk -F" " '{ print $1 }' | while read i; do service $i restart; done
```
#### Liste des modules installés:
```bash
@@ -189,10 +199,10 @@ https://support.plesk.com/hc/en-us/articles/115002557954-How-to-remove-Plesk-bac
root@localhost:~# df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-lv01 47G 44G 1,2G 98% /
root@localhost:~# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-lv01 47G 44G 1,2G 98% /
```
Remove backup logfiles:
@@ -234,3 +244,77 @@ find / -type f -size +200M -exec du -h {} + 2>/dev/null | sort -r -h
251M /var/lib/psa/dumps/domains/sur-le-sentier.fr/backup_user-data_2108080143_2108220143.tgz
```
#### How to Clear Systemd Journal Logs
##### Voir les derniers logs:
```bash
$ journalctl -r
Hint: You are currently not seeing messages from other users and the system.
Users in groups 'adm', 'systemd-journal' can see all messages.
Pass -q to turn off this notice.
-- Logs begin at Tue 2023-08-01 13:45:12 CEST, end at Tue 2023-08-01 14:18:59 CEST. --
août 01 14:18:59 localhost sshd[66502]: Disconnected from user bruno 92.184.105.67 port 59557
août 01 14:18:59 localhost sshd[66502]: Received disconnect from 92.184.105.67 port 59557:11: cleanup
août 01 14:03:57 localhost sshd[66463]: Disconnected from user bruno 92.184.105.67 port 59553
```
##### Voir la place occupée par les logs:
```bash
$ journalctl --disk-usage -q
Archived and active journals take up 24.0M in the file system.
```
##### Faire tourner les journeaux de logs:
Le journal courant est archivé, un nouveau est crée
```bash
$ sudo journalctl --rotate
```
##### Supprimer les journaux vieux de plus de 2 jours:
```bash
# 2h(ours), 2m(onths), 2w(eeks)
$ sudo journalctl --vacuum-time=2d
Vacuuming done, freed 0B of archived journals from /var/log/journal.
Deleted archived journal /var/log/journal/5fd6a638ff89491ab71a5b5150cf1c13/user-10001@74abf00168a74a3884bd8c3fc35ea7c1-0000000002757ece-0005fb79b9881a67.journal (8.0M).
Deleted archived journal /var/log/journal/5fd6a638ff89491ab71a5b5150cf1c13/system@72ce45a2f8954e2c92ac122b6c16569e-00000000027580a5-0005fb79e618be9c.journal (96.0M).
```
##### Garder 100Mo de journaux:
```bash
$ sudo journalctl --vacuum-size=100M
```
##### Garder 5 fichiers de journaux:
```bash
$ sudo journalctl --vacuum-files=5
```
##### Nettoyer automatiquement les vieux journaux:
```bash
# Sauvegarder le fichier de config de journald
$ cp /etc/systemd/journald.conf /etc/systemd/journald.conf.back
# Editer le fichier de configuration de journald
$ sudo nano /etc/systemd/journald.conf
# Décommenter la ligne SystemMaxUse
SystemMaxUse=250M
# Redémarrer journald
$ sudo systemctl restart systemd-journald
```