Category: Dev

5 Important scripts useful for a Linux system administrator

While all the scripts provided below may be accurate, there may be much more advanced features available. However, these scripts are just to give an overview of how things are meant to be done for a systems administrator. I did not make any of the below scripts and all scripts’ references are given inline along with their description.

Disk usage

This script will be useful to analyze the disk usage and if the reported disk space is more than 90 % an email will be sent to the administrator. The script is taken from here.

Incremental Backup Scripts

This script will do the incremental backup into an external mounted hard-drive. It is to take a backup of the /home directory. However, it can be modified to suit the requirements. The script is taken from here.

High CPU Usage Script

At times, we need to monitor the high CPU usage in the system. We can use the below script to monitor the high CPU usage. The script is taken from here.

Adding new users to a Linux system

This script allows the root user or admin to add new users to the system in an easier way by just typing the user name and password (The password is entered in an encrypted manner). The below script is taken from here.

Database Backup

This script is a pretty basic script useful in backing up the database. The script is taken from here.

Source : http://unix.stackexchange.com/questions/125726/important-scripts-useful-for-a-linux-system-administrator

More

Script : Color_bash.sh

Travaillant actuellement sur une fonction d’affichage pour les scripts bash, je vous partage un petit qui vous affichera dans le terminal les couleurs et leur code associé en bash.

skynet.tomzone.fr - PuTTY_2

Source : https://github.com/fikovnik/bin-scripts

More

Bash – Utiliser une regex pour vérifier un date

Dernièrement, pour le besoin d’un script, il me fallait créer une regex pour check que les dates étaient valide.

Voici la regex que j’ai utilisé

Il suffit ensuite de le mettre dans un while et d’ajouter un read pour avoir une boucle qui pose et repose la question tant que la date entrée dans le terminal n’est pas valide.

J’utilise dans ce cas la le format de date anglais YYYY-MM-DD

(suite…)

More