Home » Infrastructure » Unix » How to launch a program when arrival of the file (merged)
How to launch a program when arrival of the file (merged) [message #313559] Sun, 13 April 2008 13:50 Go to next message
msuphaluk
Messages: 20
Registered: December 2007
Location: BKK,Thailand
Junior Member
Dear All,
I would like to ask for any suggestion from you. I am having a user requirement to write a shell script to check for on arrival on the file and then execute a program.

For example: when user sends the file .dat then send the file .ok. in target directory. Then my program will automatical execute. But my p/b is how can I know when this file is placed in target directory.

Any suggestion or hit are totally welcome.

Best regards,
Suphaluk M.
How to launch a program when arrival of the file [message #313561 is a reply to message #313559] Sun, 13 April 2008 13:51 Go to previous messageGo to next message
msuphaluk
Messages: 20
Registered: December 2007
Location: BKK,Thailand
Junior Member
Dear All,
I would like to ask for any suggestion from you. I am having a user requirement to write a shell script to check for on arrival on the file and then execute a program.

For example: when user sends the file .dat then send the file .ok. in target directory. Then my program will automatical execute. But my p/b is how can I know when this file is placed in target directory.

Any suggestion or hit are totally welcome.

Best regards,
Suphaluk M.
Re: How to launch a program when arrival of the file [message #313562 is a reply to message #313561] Sun, 13 April 2008 14:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Put a job in crontab that check it every minute.

Regards
Michel
Re: How to launch a program when arrival of the file [message #313563 is a reply to message #313559] Sun, 13 April 2008 14:04 Go to previous messageGo to next message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Don't multipost.

Regards
Michel
Re: How to launch a program when arrival of the file (merged) [message #313577 is a reply to message #313559] Sun, 13 April 2008 18:34 Go to previous messageGo to next message
msuphaluk
Messages: 20
Registered: December 2007
Location: BKK,Thailand
Junior Member
Thank you for your information.

Is there only this way to solve my requirement?

Best regards,
Suphaluk M.
Re: How to launch a program when arrival of the file (merged) [message #313584 is a reply to message #313559] Sun, 13 April 2008 19:17 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Is there only this way to solve my requirement?
This is the equivalent as asking is there a tool other than the saw which can be used to cut a board.

Yes, you could use a hammer,
but it would take more effort to use a hammer to make 2 pieces of lumber out of 1 board
& the results would be much messier.
Re: How to launch a program when arrival of the file (merged) [message #313645 is a reply to message #313559] Mon, 14 April 2008 00:53 Go to previous message
msuphaluk
Messages: 20
Registered: December 2007
Location: BKK,Thailand
Junior Member
Good comparison. I can see the picture.

I asked above question I have seen one client uses this method and the program will be launched right away after arrival of the file. That mean he put the constab to check for a few second.

By the way, Thank a lot for all kindly informations.

Regards,
Suphaluk M.
Previous Topic: Variable value passing between Unix shell - PL/SQL block
Next Topic: how to know whether oracle is installed or not?
Goto Forum:
  


Current Time: Wed Dec 11 01:40:46 CST 2024