- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ftp tiggering
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
Forums
Discussions
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
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
01-08-2002 03:38 AM
01-08-2002 03:38 AM
we have an ftp server for customers to put their accounting files to be processed by our company...they put their standart-named file via ftp...every customer has a home directory,
which has two sub-directories,one to put files, the other to get the processed file by the mainframe...the communication between the unix box and the mainframe is done via edm...up to now, we used to have a cron job that works every half an hour and searches for the new files that have been put by customers...but because the number of customers
growed rapidly,we have timing problems with other cron jobs...
is there a way that when the customer ftps the file, i can automatically be aware of this, and trigger the edm program to process the file,thus by avoiding the need for the cron jobs..
thanks...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2002 04:12 AM
01-08-2002 04:12 AM
Re: ftp tiggering
Is the problem that as your customers increase then to circulate and process the file conversions is taking more and more time.
Just an idea can you put in the .profile of the customers dir a small script to identify their logout and then check for the presence of their file and then action it.
HTH
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2002 05:02 AM
01-08-2002 05:02 AM
SolutionIf you set the ftpd to log in verbose mode (add the -l -v switches in /etc/inetd.conf and send the inetd process a HUP signal), you could monitor the log file with something like:
==========================================
#!/bin/ksh
tail -1f /var/adm/syslog/syslog.log | while read line ; do
echo $line | grep -q 'FTP LOGIN'
if [ $? -eq 0 ] ; then
echo $line | sed 's/.*ftpd\[\([^]]*\).*, \(.*\)/\1 \2/' | read pid user
echo $user > /var/tmp/ftp.${pid}
continue
fi
echo $line | grep -q 'FTP: store'
if [ $? -eq 0 ] ; then
echo $line | sed 's/.*ftpd\[\([^]]*\)]: FTP: store \(.*\)$/\1 \2/' | read pid file
echo $file transferred by `cat /var/tmp/ftp.${pid}`
YOUR PROCESS...
fi
done
=====================================
where YOUR PROCESS is the edm transfer procedure. The /var/tmp/ftp.$pid files would contain the username, and would need tidying up occasionally.
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2002 05:04 AM
01-08-2002 05:04 AM
Re: ftp tiggering
1. A regular cron job.
2. A 'daemon' process that is always running that regularly checks your incoming directories.
It's also possible to extend the amount of information logged by ftpd (amend /etc/inetd.conf to add the v flag) then change your 'daemon' process to watch the syslog for relevant ftp messages. This is a bit complicated though - what are the 'timing problems' that you are experiencing with cron jobs?
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2002 05:36 AM
01-08-2002 05:36 AM
Re: ftp tiggering
first of all, when the cron script starts
searching all of the customers directory,
it takes a couple of minutes to finish this job...we search the new files, by comparing their names with the names stored in a special
file-in which the early transferred files names resided in order to not to send them again to pool...the files found as "new" are
all sent to a directory(which we call a "pool"), and a new cron job is started for
edm to transfer these files to mainframe...
the time between these two cron-jobs need to be
little, in order to process the files rapidly...this was o good way before we have
not so many customers,but now it suffers,in both adminastring and problem solving...
that's why, we decide the trigger the scripts..
by the way, a new question:
does ftp users have their .profile executed?
thank u all
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2002 05:42 AM
01-08-2002 05:42 AM
Re: ftp tiggering
change the name of ftpd, to something like wrapped_ftpd.
Then, create a script like this, called ftpd:
#!/usr/bin/ksh
#
touch /tmp/ftptime_start
/usr/lbin/wrapped_ftpd
touch /tmp/ftptime_stop
Of course, change the "touches" to whatever you want, that will perform a directory scan for newly deposited files.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2002 05:44 AM
01-08-2002 05:44 AM
Re: ftp tiggering
chmod 544 ftpd
chown bin:bin ftpd
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2002 05:55 AM
01-08-2002 05:55 AM
Re: ftp tiggering
This would trigger more, but smaller edm scripts.
I would also suggest that the userid be passed as a parameter of the edm script so that you still would only have to maintain one script.