#!/bin/bash
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Identifies corrupted ZIP/JAR/WAR files.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if [ ! -z ${1} ]; then
echo "Scanning ${1} ..."
if [ -d "${1}" ]; then
find ${1} -regex ".*\.\(jar\|war\|zip\)" | xargs -L 1 zip -T | grep error | grep invalid
echo "Finished searching for invalid ZIP/JAR/WAR"
else
echo "You need to supply a directory !"
fi
else
echo "You need to supply a directory !"
fi
#!/bin/sh
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Makes sure that the source directory will be synced with a target directory as long as this script keeps going.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FROM=${1}
TO=${2}
while inotifywait -r -e modify -e create -e delete ${FROM}; do
rsync -p -r ${FROM} ${TO}
done