Script used for monitoring:
#!/bin/bash
oldTime=$(date +%s) oldPsOutput=$(ps faux) while sleep 1 do currentTime=$(date +%s) currentPsOutput=$(ps faux) if [ "$currentTime" -lt "$oldTime" ] # clock change detected? then ( echo '=========' echo "$currentTime < $oldTime" echo "$oldPsOutput" echo ':::::::::' echo "$currentPsOutput" ) | mail -s "Time jump" root fi oldPsOutput=$currentPsOutput oldTime=$currentTime done
Script used for monitoring:
#!/bin/bash
oldTime=$(date +%s) $(date +%s) ut=$(ps faux) $currentPsOutpu t $currentTime
oldPsOutput=$(ps faux)
while sleep 1
do
currentTime=
currentPsOutp
if [ "$currentTime" -lt "$oldTime" ] # clock change detected?
then
(
echo '========='
echo "$currentTime < $oldTime"
echo "$oldPsOutput"
echo ':::::::::'
echo "$currentPsOutput"
) | mail -s "Time jump" root
fi
oldPsOutput=
oldTime=
done