<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: File watcher in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/file-watcher/m-p/3282037#M882170</link>
    <description># assumptions:&lt;BR /&gt;# files comes into /tmp/ftp/upload&lt;BR /&gt;# you have a directory /tmp/ftp/archive&lt;BR /&gt;&lt;BR /&gt;delay=3 # in seconds wait betwwen checks&lt;BR /&gt;while true &lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;if [ -a * ]&lt;BR /&gt;then &lt;BR /&gt;mv /tmp/ftp/upload/* /tmp/ftp/archive&lt;BR /&gt;echo "file(s) received" | mailx -s "New files arrived" user@domain.com&lt;BR /&gt;else&lt;BR /&gt;sleep $delay&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;hope it helps</description>
    <pubDate>Thu, 20 May 2004 09:46:56 GMT</pubDate>
    <dc:creator>Mel Burslan</dc:creator>
    <dc:date>2004-05-20T09:46:56Z</dc:date>
    <item>
      <title>File watcher</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-watcher/m-p/3282036#M882169</link>
      <description>File watcher logic; , for instance as soon as the file is sent from External system to our internal system, email needs to be sent to respective users about the files have arrived.&lt;BR /&gt;&lt;BR /&gt;Could someone help me with the script</description>
      <pubDate>Thu, 20 May 2004 09:39:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-watcher/m-p/3282036#M882169</guid>
      <dc:creator>la_cool</dc:creator>
      <dc:date>2004-05-20T09:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: File watcher</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-watcher/m-p/3282037#M882170</link>
      <description># assumptions:&lt;BR /&gt;# files comes into /tmp/ftp/upload&lt;BR /&gt;# you have a directory /tmp/ftp/archive&lt;BR /&gt;&lt;BR /&gt;delay=3 # in seconds wait betwwen checks&lt;BR /&gt;while true &lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;if [ -a * ]&lt;BR /&gt;then &lt;BR /&gt;mv /tmp/ftp/upload/* /tmp/ftp/archive&lt;BR /&gt;echo "file(s) received" | mailx -s "New files arrived" user@domain.com&lt;BR /&gt;else&lt;BR /&gt;sleep $delay&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;hope it helps</description>
      <pubDate>Thu, 20 May 2004 09:46:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-watcher/m-p/3282037#M882170</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2004-05-20T09:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: File watcher</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-watcher/m-p/3282038#M882171</link>
      <description>sorry.. one oversight&lt;BR /&gt;&lt;BR /&gt;the line with if should have read like this &lt;BR /&gt;&lt;BR /&gt;if [ -a /tmp/ftp/upload/* ]&lt;BR /&gt;&lt;BR /&gt;or whatever the directory name that your upload files are coming into&lt;BR /&gt;</description>
      <pubDate>Thu, 20 May 2004 09:48:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-watcher/m-p/3282038#M882171</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2004-05-20T09:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: File watcher</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-watcher/m-p/3282039#M882172</link>
      <description>Not until you do some more work yourself like drawing up a few specifications. Typically, the files arrive in a dedicated directory or directory tied to a particular user.&lt;BR /&gt;&lt;BR /&gt;Start writing the detailed specifications and you just might find that the script all but writes itself. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 20 May 2004 09:49:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-watcher/m-p/3282039#M882172</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-05-20T09:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: File watcher</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-watcher/m-p/3282040#M882173</link>
      <description>Here is the approach.&lt;BR /&gt;&lt;BR /&gt;1) cron runs the script. man crontab to set that up.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;find /directory -name * &amp;gt; /tmp/filelist&lt;BR /&gt;&lt;BR /&gt;while read -r rr&lt;BR /&gt;do&lt;BR /&gt;   echo $rr&lt;BR /&gt;   # if the filename meets your criteria send &lt;BR /&gt;   # email&lt;BR /&gt;   if [ "$mailflag" == "Y" ]&lt;BR /&gt;   then&lt;BR /&gt;      echo "you have a file $rr" | mailx -s "You have a file" someone@some.net&lt;BR /&gt;   fi&lt;BR /&gt;&lt;BR /&gt;done &amp;lt; /tmp/filelist&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The find command is pretty hard on your system, I don't reccommend running it more than every five minutes.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 20 May 2004 09:49:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-watcher/m-p/3282040#M882173</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-05-20T09:49:57Z</dc:date>
    </item>
  </channel>
</rss>

