Skip to content

Instantly share code, notes, and snippets.

@atulsingh0
Last active August 29, 2015 14:27
Write a script which will check for a given file in every 60 seconds in a given directory, if find, send us a mail else keep running. We do not want to set this script in crontab.
#!/bin/ksh
#=================================================================================================================================
# Write a script which will check for a given file in every 60 seconds in a given directory,
#if find, send us a mail else keep running. We do not want to set this script in crontab.
# Author - Atul Singh
# Date - Aug 23, 2015
# Scenario - http://www.datagenx.net/2015/08/linux-shell-script-scenario-2.html
# www.DataGenX.net
#=================================================================================================================================
while :
do
sleep 60 & pid=$!
some_command arg1 arg2
wait $pid
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment