Skip to content

Instantly share code, notes, and snippets.

View Termiux's full-sized avatar

Jorge Moreno Termiux

  • HP Enterprise Services
  • United States
View GitHub Profile
@Termiux
Termiux / This is my monit control file
Created October 12, 2011 19:34
Monit control file
################################################################################
############################# Monit control file #############################
################################################################################
##
#
# Comments begin with a '#' and extend through the end of the line. Keywords
# are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
#
@Termiux
Termiux / configBackup.sh
Created October 11, 2011 00:50
Configuration files manager backups and restores
#!/bin/bash
currentDate=`date +%F` # Gets current day in full formate
outputName="configBackup-$currentDate"; # Sets the output file name
tmp="/tmp"; # Sets temp folder location
randStr=`</dev/urandom tr -dc A-Za-z0-9 | head -c8`; # Stores a random string of letters and numbers of 8 characters in length
tmpFullDirName=$tmp/"configBackup-$randStr" # Sets the name of temporal folder from where the script will work
backupTargetDir=$tmpFullDirName; # Sets the temporal folder that we'll backup, this is the full previous variable
workingDir=`pwd` # Gets the folder path from where we ran the script
folderList=`ls -l | egrep '^d' | awk '{ print $9 }'`