Scripting

Howto: Run crone job in seconds

Posted on Updated on

Here I have wrote a simple scripts to execute crone jobs in seconds of time. Using this we can schedule a job less than a minute,

#This script  to sync files fro EBS storage to S3  mounted under /ebs /s3cloud
_Seconds=2
a=0

_Delay=$(echo "60/$_Seconds" | bc)

while true
do a=$((a+1))
if [ "$a" == "$_Delay" ]; then
 exit 0
else
 sleep $_Seconds
 /usr/bin/rsync -abvz --size-only /ebs/ /s3cloud/
fi
done