Bash – Launch new terminals

A simple example to launch terminals (gnome-terminal) with bash. This example launches 4 terminals; each monitoring the system in a different way. #!/bin/bash # [Eaxample] Helper script to launch CLI apps # Created to use gnome-terminal (e.g. instead of pterm, etc) ROUTING_TABLE_CMD=”watch -n 30 netstat -r” DISK_USAGE_CMD=”watch -n 60 df -h” ACTIVE_PROCESSES_CMD=”top -a” MEMORY_UTILIZATION_CMD=”watch -n …

Bash – Launch new terminals Read More »

Simple website backup script

I have used variation of this backup script for quick backups of typical LAMP stack websites (e.g. based on Drupal or WordPress). This saves the database along with the files into an archive… #!/bin/bash # Database connection information dbname=database_name dbhost=localhost dbuser=database_user dbpass=database_password homedir=/var/www/ webrootdir=html # Default TAR Output File Base Name tarnamebase=website_backup-datestamp=`date +’%Y-%m-%d-%H-%M-%S’` cd $homedir …

Simple website backup script Read More »