Posts for: #Linux

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