Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.
Obě strany předchozí revize Předchozí verze Následující verze | Předchozí verze | ||
software:linux:commands [2018/12/12 13:11] root |
software:linux:commands [2021/11/23 13:27] (aktuální) mwk |
||
---|---|---|---|
Řádek 1: | Řádek 1: | ||
- | ===== 1 tail ===== | + | ====== Commands ====== |
+ | ===== badblocks ===== | ||
+ | <code bash> | ||
+ | * verbose | ||
+ | * force | ||
+ | * write | ||
+ | * show progress | ||
+ | |||
+ | ===== tail ===== | ||
vypis logu v realnem case | vypis logu v realnem case | ||
<code bash> | <code bash> | ||
Řádek 6: | Řádek 14: | ||
<code bash> | <code bash> | ||
- | ===== 2 ssh key pro vzdalene prihlasovani klientu pres ssh ===== | + | ===== ssh key pro vzdalene prihlasovani klientu pres ssh ===== |
ssh rsa key generovani - nezadavat passphrase | ssh rsa key generovani - nezadavat passphrase | ||
<code bash> | <code bash> | ||
Řádek 12: | Řádek 20: | ||
<code bash> | <code bash> | ||
- | ===== 3 ssh klice 2 ===== | + | ===== ssh klice 2 ===== |
**server**: jako root | **server**: jako root | ||
<code bash> | <code bash> | ||
Řádek 25: | Řádek 33: | ||
cat / | cat / | ||
- | ===== 4 symlink zmena targetu bez smazani ===== | + | ===== symlink zmena targetu bez smazani ===== |
<code bash>ln -f -s /home/zdroj / | <code bash>ln -f -s /home/zdroj / | ||
- | ===== 5 SED ===== | + | ===== SED ===== |
<code bash>sed -i ' | <code bash>sed -i ' | ||
-i = in-place (i.e. save back to the original file) | -i = in-place (i.e. save back to the original file) | ||
s = the substitute command | s = the substitute command | ||
g = global (i.e. replace all and not just the first occurrence) | g = global (i.e. replace all and not just the first occurrence) | ||
+ | |||
+ | ===== awk ===== | ||
+ | <code bash> | ||
+ | najde numericke hodnoty za " | ||
+ | |||
+ | ===== OPENSSL na Debianu ===== | ||
+ | |||
+ | <code bash>apt install certbot python-certbot-apache</ | ||
+ | |||
+ | zkontrolovat /etc/hosts, jestli je cele jmeno na lokalni IP a generujeme: | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | Pak to chce zkusit na automatickou obnovu udelat skript a dat do cronu pomoci | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | |||
+ | ===== Rdiff-backup ===== | ||
+ | **backup - server** a nasledne i klient jako root | ||
+ | |||
+ | <code bash> | ||
+ | rdiff-backup --version</ | ||
+ | |||
+ | * verze server - klient by se mely shodovat | ||
+ | * vygenerujeme klice pro roota, dle ssh klic 2 a budeme distribuovat na klienty nasledne | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | **priklad zalohy** | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | takhle s tim do cronu | ||
+ | <file bash gpiobackup.sh> | ||
+ | !/bin/bash | ||
+ | ## gpiobackup script | ||
+ | # Backup | ||
+ | rdiff-backup --exclude /tmp --exclude /mnt --exclude /proc --exclude /sys --exclude /run --exclude /dev --exclude /var/backup -v5 root@10.133.$ | ||
+ | sleep 5 | ||
+ | rdiff-backup --exclude /tmp --exclude /mnt --exclude /proc --exclude /sys --exclude /run --exclude /dev --exclude /var/backup -v5 root@10.133.$ | ||
+ | sleep 5 | ||
+ | rdiff-backup --exclude /tmp --exclude /mnt --exclude /proc --exclude /sys --exclude /run --exclude /dev --exclude /var/backup -v5 root@10.133.$ | ||
+ | # Clean Increments | ||
+ | rdiff-backup --force --remove-older-than 4B / | ||
+ | rdiff-backup --force --remove-older-than 4B / | ||
+ | rdiff-backup --force --remove-older-than 4B / | ||
+ | </ | ||
+ | vypis logu v realnem case | ||
+ | <code bash> | ||
+ | vyber ze souboru | ||
+ | <code bash> | ||
+ | <code bash> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ |