Computing.Net > Forums > Unix > unix trigger

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

unix trigger

Reply to Message Icon

Name: Jernand
Date: November 30, 2004 at 15:38:15 Pacific
OS: hp-ux
CPU/Ram: 320
Comment:

Hi,

I wud like a unix script to execute on a trigger..the trigger wud be when a ftp is done(upon file arrival0-any file on a directory.
thanks for ur help.

Regards,
Jern



Sponsored Link
Ads by Google

Response Number 1
Name: Jim Boothe
Date: December 1, 2004 at 06:32:09 Pacific
Reply:

Search this forum for plenty of other examples.

This code will wake up each 60 seconds and process each regular file in mydir.

while true
  do
  for fname in $(ls mydir)
    do
    if test -f $fname ; then
       echo "Processing $fname ..."
       # < your code here >
    fi
    done
  sleep 60
  done


0

Response Number 2
Name: frank dolivka
Date: December 1, 2004 at 06:40:48 Pacific
Reply:

while :
do
count=`ls /DownloadDir/ | wc -l `
old_count=`cat /tmp/Trigger.count |wc -l`
if [ $old_count -ne $count ]
then
do what you want
ls /DownloadDir/ > /tmp/Trigger.count
fi
done


Cheers Frank Dolivka

Regards
Frank Dolivka
No Risk No Fun


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


grep SQL code freebsd pcmcia modem card



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: unix trigger

Unix to Trigger Pop-up in Win95 - Help www.computing.net/answers/unix/unix-to-trigger-popup-in-win95-help/853.html

Unix script using Korn Shell www.computing.net/answers/unix/unix-script-using-korn-shell/7393.html

need help for learning unix script www.computing.net/answers/unix/need-help-for-learning-unix-script/7745.html