Posts for: #Linux

SMART

Self-Monitoring, Analysis and Reporting Technology is a system for monitoring and recognizing errors of storage media like Hard Disk Drives (HDDs) and Solid State Disks (SSD).

All HDDs and SSDs (refered to as HDD in the following) have SMART functionality while some external drive cases do NOT support reading SMART values from the HDD directly.

Since SMART is not a standardised procedure or well-defined value collection, these values differ greatly between manufacturers and might indicate death for some hard drives while others do not even show or update said values.

[Read more]

Linux Backup for Files and Databases Zipped Cronjob Scheduled

Backing up files in Linux is possible in multiple different ways but in my case…

…I am currently trying out different backup strategies with rsync and zip

rsync because of running servers, with a temporary directory

zip because I need acces to files in Windows (in the worst case at least)

And I need some database dumps in there as well!

Let’s go then

First of all I define the variables I need like folder names and backup dates for files and folders

[Read more]

A Linux Commands Overview

Some useful terminal commands in Linux or OSX

-> List all cronjobs from all users and services (all existing)

for user in $(cut -f1 d: /etc/passwd); do crontab -u $user -l; done

-> For all users and services in /etc/passwd

for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done

-> A nicer list for each user in /etc/passwd

-> Find and delete 10 days old files in /tmp

find /tmp -ctime +10 -exec rm -rf {} +

-> Zip and Tar over SSH compression

[Read more]

Linux Installation of Zsh and Oh My Zsh

This can be done in two or three easy steps:

  1. sudo apt-get install zsh curl git
  2. sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  3. (optional, must be installed for the agnoster theme for example (see here)) sudo apt-get install fonts-powerline (echo "\ue0b0 \u00b1 \ue0a0 \u27a6 \u2718 \u26a1 \u2699" to test)
[Read more]