server-befehle/README.md

44 lines
1.4 KiB
Markdown
Raw Normal View History

2019-09-23 07:36:52 +00:00
# server-befehle
2019-09-23 07:45:12 +00:00
## Festplattenverbrauch ermitteln:
2019-09-23 07:39:21 +00:00
```
df -h
```
2019-09-23 07:45:12 +00:00
### du (Disk Usage)
```
du /home/
```
https://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/
### ncdu (CLI-based)
```
sudo apt install ncdu
ncdu
```
## rsync
2019-09-23 07:39:21 +00:00
Rsync ohne Rechteübernahme (gut für gemountete Laufwerke SAMBA)
```
sudo rsync -rltv --exclude '/storage/tzm_de/var/lib/nextcloud/*' /storage/ /mnt/backup-storage/
```
2019-09-23 19:17:53 +00:00
### Hetzner
```
rsync --progress -e 'ssh -p23' --recursive <Lokales Verzeichnis> <Benutzername>@<Benutzername>.your-storagebox.de:<Ziel Verzeichnis>
rsync --progress -e 'ssh -p23' --recursive <Benutzername>@<Benutzername>.your-storagebox.de:<Verzeichnis> <Lokales Verzeichnis>
```
https://wiki.hetzner.de/index.php/Storage_Boxes
2019-09-23 07:39:21 +00:00
2019-09-23 19:21:37 +00:00
## Cronjob
### QNAP
2019-09-23 19:23:21 +00:00
**Do NOT edit crontab the usual way!** `crontab -e`
2019-09-23 19:21:37 +00:00
However, due to the way the QNAP firmware updates crontab, it will be overwritten on the next reboot. Obviously, you want your automation to survive reboots, so edit the crontab file directly with your text editor:
```
vim /etc/config/crontab
```
2019-09-23 19:22:22 +00:00
When you're done, reload the crontab file and restart the cron daemon:
```
crontab /etc/config/crontab && /etc/init.d/crond.sh restart
```
2019-09-23 07:39:21 +00:00
## Gute Quellen
* Bash-Skripte: https://wiki.ubuntuusers.de/Shell/Bash-Skripting-Guide_für_Anfänger/
* Cronjobs: https://www.stetic.com/developer/cronjob-linux-tutorial-und-crontab-syntax.html