This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
linux_skodi [2020/02/27 13:52] ww [SMTP relay pro tupé tiskárny] |
linux_skodi [2024/06/13 15:31] (current) ww |
||
|---|---|---|---|
| Line 269: | Line 269: | ||
| - ??? | - ??? | ||
| - Profit | - Profit | ||
| + | |||
| + | **Důležité**: | ||
| + | - U Office 365 je při posílání mailu potřeba mít "'' | ||
| Otestování konfigurace | Otestování konfigurace | ||
| Line 280: | Line 283: | ||
| ---- | ---- | ||
| + | |||
| + | ===== Borg Backup ===== | ||
| + | |||
| + | <code bash> | ||
| + | #!/bin/sh | ||
| + | |||
| + | # Setting this, so the repo does not need to be given on the commandline: | ||
| + | export BORG_REPO=ssh://< | ||
| + | |||
| + | export BORG_PASSPHRASE="< | ||
| + | |||
| + | # some helpers and error handling: | ||
| + | info() { printf "\n%s %s\n\n" | ||
| + | trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM | ||
| + | |||
| + | info " | ||
| + | |||
| + | # Backup the most important directories into an archive named after | ||
| + | # the machine this script is currently running on: | ||
| + | |||
| + | borg create | ||
| + | --verbose | ||
| + | --filter AME \ | ||
| + | --list | ||
| + | --show-rc | ||
| + | --stats | ||
| + | --compression lz4 \ | ||
| + | --exclude-caches | ||
| + | --exclude '/ | ||
| + | --exclude '/ | ||
| + | --exclude '/ | ||
| + | --exclude '/ | ||
| + | --exclude '/ | ||
| + | --exclude ' | ||
| + | \ | ||
| + | ::' | ||
| + | /etc \ | ||
| + | /home \ | ||
| + | /root \ | ||
| + | /var \ | ||
| + | |||
| + | backup_exit=$? | ||
| + | |||
| + | info " | ||
| + | |||
| + | # Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly | ||
| + | # archives of THIS machine. The ' | ||
| + | # limit prune' | ||
| + | # other machines' | ||
| + | |||
| + | borg prune \ | ||
| + | --list | ||
| + | --prefix ' | ||
| + | --show-rc | ||
| + | --keep-daily | ||
| + | --keep-weekly | ||
| + | --keep-monthly | ||
| + | |||
| + | prune_exit=$? | ||
| + | |||
| + | # use highest exit code as global exit code | ||
| + | global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit )) | ||
| + | |||
| + | if [ ${global_exit} -eq 1 ]; | ||
| + | then | ||
| + | info " | ||
| + | fi | ||
| + | |||
| + | if [ ${global_exit} -gt 1 ]; | ||
| + | then | ||
| + | info " | ||
| + | fi | ||
| + | |||
| + | exit ${global_exit} | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== fstab - příklad ===== | ||
| + | |||
| + | < | ||
| + | fstab | ||
| + | |||
| + | # <file system> | ||
| + | proc / | ||
| + | |||
| + | UUID=27d259c9-f4a8-4749-b8a7-b9a0f019a3c4 | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Docker ===== | ||
| + | |||
| + | === Instalace Ubuntu === | ||
| + | < | ||
| + | # Adding an ASCII Armored key (.asc key) | ||
| + | curl -fsSL https:// | ||
| + | gpg --dearmor | \ | ||
| + | sudo tee / | ||
| + | /dev/null | ||
| + | |||
| + | # Or if you prefer a one-liner | ||
| + | curl -fsSL https:// | ||
| + | |||
| + | # Breakdown of each part | ||
| + | # | ||
| + | # curl | ||
| + | # gpg --dearmor | ||
| + | # sudo tee | ||
| + | # / | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | echo \ | ||
| + | "deb [arch=$(dpkg --print-architecture) signed-by=/ | ||
| + | sudo tee / | ||
| + | /dev/null | ||
| + | |||
| + | |||
| + | # Of if you prefer a one-liner | ||
| + | echo "deb [arch=$(dpkg --print-architecture) signed-by=/ | ||
| + | </ | ||
| + | |||
| + | === One-time rychlovka bouračka === | ||
| + | <code bash> | ||
| + | ('' | ||
| + | |||
| + | ===== Výpis síťových zařízení ===== | ||
| + | |||
| + | < | ||
| + | |||
| + | H/W path Device | ||
| + | ==================================================================== | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | /4 enp46s0d1 | ||
| + | |||
| + | ===== Rychlost síťových rozhraní ===== | ||
| + | |||
| + | < | ||
| + | |||
| + | ===== Shellovinky ===== | ||
| + | |||
| + | === Poslání mailu z shellu, specifikace odesílatele (" | ||
| + | <code bash> | ||
| + | |||
| + | === rsync === | ||
| + | <code bash> | ||