Backup using shell script (this example weblogic domain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 | #!/bin/bash -e
set -euf -o pipefail
echo "Starting Backup"
DATE=`date +%Y-%m-%d-%H.%M.$$`
echo "Starting Backup, except *.tar extensions"
tar -zcvf blog-"${DATE}".tar.gz --exclude='*.tar' .
if [ "$?" -eq "0" ]
then
echo "Backup Successfully..."
exit 0
else
echo "Backup has failed, please check"
exit 1
fi
|
CLEAN LOG - SCRIPT
[weblogic@snake001]$ cat limpa.sh
cat /dev/null `>` /logs/HmlWLS/BusCloud_60101.log;
Linux Automation Scripts Gitlab REPO
Linux Automation Scripts
General Scripts
Quick script to kill PID's
| #!/bin/bash
set -euf -o pipefail
PID=`sudo ps -eaf | grep syncapp | grep -v grep | awk '{print $2}'`
if [ "" != "$PID" ]; then
echo "killing $PID"
sleep 3
sudo kill -9 $PID
fi
|