This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export SRC_DATA_DIR=/home/user/source | |
export DEST_DATA_DIR=/home/user/destination | |
export DATE_EXEC=${DATE_EXEC:-$(date +%Y%m%d_%H%M%S)} | |
export TMP_DIR=/tmp/myscripttmpdir | |
export LOGS_DIR=$SCRIPT_DIR/logs | |
export SRC_DB_USER=user | |
export SRC_DB_PASSWD=password | |
export SRC_DB_NAME=db1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DISC=$1 | |
[ -z "$DISC" ] && DISC=/ | |
PARTITION=`df -h |grep $DISC |awk '{print $1}'` | |
SIZE=`df -h|grep $DISC|awk '{print $2}'` | |
USED=`df -h|grep $DISC|awk '{print $3}'` | |
FREE=`df -h|grep $DISC|awk '{print $4}'` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Exemple of configurable cleaner for oldest file in a directory | |
# Use case of this exemple : | |
# * a script that uses a temp file (writing timestamp in its name for exemple) | |
# * by default it removes its temp file at the end (and only this one) | |
# * for debug purpose we would like to keep the file, or several historic files | |
# * with "KEEP_FILE" we can set : 0 (clean all) 1 (only latest) X (youngest files) "ALL" (keep all files) | |
#configuration | |
TARGET_DIR=~/tmp/test | |
KEEP_FILE=3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# http://www.sebdangerfield.me.uk/2011/02/old_file_removal_bash-script/ | |
# ex: ./remove_old_files.sh 30 /home/myuser/large_file_count_dir | |
if [ $# -ne 2 ] ; then | |
echo "Not enough arguments. | |
Please pass the number of files to keep followed by the path" | |
exit 1 | |
fi | |
# First argument is the number of files to keep! | |
KEEP_NUM=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
COUNTER=2 | |
TARGETDIR=/home/jalios/dumpCPUStack | |
PID=$(cat /home/jalios/instance/tomcat.pid) | |
#PID=$(ps h -fu tomcat | grep jplatform | awk '{print $2}') | |
echo "This script will dump $COUNTER times the threads stacks and CPU usage for process pid=$PID" | |
while [ $COUNTER -gt 0 ]; do |