- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- File watcher
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2004 02:39 AM
05-20-2004 02:39 AM
File watcher
Could someone help me with the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2004 02:46 AM
05-20-2004 02:46 AM
Re: File watcher
# files comes into /tmp/ftp/upload
# you have a directory /tmp/ftp/archive
delay=3 # in seconds wait betwwen checks
while true
do
if [ -a * ]
then
mv /tmp/ftp/upload/* /tmp/ftp/archive
echo "file(s) received" | mailx -s "New files arrived" user@domain.com
else
sleep $delay
fi
done
hope it helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2004 02:48 AM
05-20-2004 02:48 AM
Re: File watcher
the line with if should have read like this
if [ -a /tmp/ftp/upload/* ]
or whatever the directory name that your upload files are coming into
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2004 02:49 AM
05-20-2004 02:49 AM
Re: File watcher
Start writing the detailed specifications and you just might find that the script all but writes itself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2004 02:49 AM
05-20-2004 02:49 AM
Re: File watcher
1) cron runs the script. man crontab to set that up.
find /directory -name * > /tmp/filelist
while read -r rr
do
echo $rr
# if the filename meets your criteria send
if [ "$mailflag" == "Y" ]
then
echo "you have a file $rr" | mailx -s "You have a file" someone@some.net
fi
done < /tmp/filelist
The find command is pretty hard on your system, I don't reccommend running it more than every five minutes.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com