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
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s