Розбіжності
Тут показані розбіжності між вибраною ревізією та поточною версією сторінки.
Порівняння попередніх версій Попередня ревізія Наступна ревізія | Попередня ревізія | ||
debian:syslog-ng [25/07/2024 21:04] – [On Syslog-NG server] Method | debian:syslog-ng [25/07/2024 22:17] (поточний) – [Install Syslog-NG] Method | ||
---|---|---|---|
Рядок 3: | Рядок 3: | ||
<code bash> | <code bash> | ||
- | wget -qO - https:// | + | wget -qO - https:// |
- | echo "deb https:// | + | echo " |
apt update | apt update | ||
apt-get install syslog-ng-core syslog-ng-scl | apt-get install syslog-ng-core syslog-ng-scl | ||
Рядок 32: | Рядок 33: | ||
destination d_a10nat_json_main { | destination d_a10nat_json_main { | ||
file( | file( | ||
- | "/var/log/syslog-ng/ | + | "/nfs/ |
template(" | template(" | ||
create_dirs(yes) | create_dirs(yes) | ||
Рядок 41: | Рядок 42: | ||
destination d_a10nat_json_backup { | destination d_a10nat_json_backup { | ||
file( | file( | ||
- | "/ | + | "/ |
template(" | template(" | ||
create_dirs(yes) | create_dirs(yes) | ||
Рядок 59: | Рядок 60: | ||
filter(f_a10nat_cgnat); | filter(f_a10nat_cgnat); | ||
destination(d_a10nat_json_backup); | destination(d_a10nat_json_backup); | ||
- | when not exists("/ | + | when not exists("/ |
flags(flow-control); | flags(flow-control); | ||
}; | }; | ||
</ | </ | ||
- | |||
systemctl restart syslog-ng | systemctl restart syslog-ng | ||
Рядок 98: | Рядок 98: | ||
! | ! | ||
</ | </ | ||
+ | |||
+ | ==== Скрипт міграції логів ==== | ||
+ | |||
+ | nano / | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | |||
+ | # Перевірка, | ||
+ | if mountpoint -q / | ||
+ | echo " | ||
+ | find / | ||
+ | find / | ||
+ | else | ||
+ | echo " | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | chmod +x / | ||
+ | crontab -e | ||
+ | |||
+ | <code bash> | ||
+ | */5 * * * * / | ||
+ | </ | ||
+ | |||