0

I have a main script in a folder called main.ksh (in /home/pkawar/folder), and its input input file inputfile.xls (in /home/pkawar/folder/ipfile).

  1. When I run main.ksh, it uses inputfile.xls and deliver the output to a mail address.

  2. The inputfile.xls is loaded to path /home/pkawar/folder/ipfile via ftp commands.

Is it possible to run main.ksh automatically and output will be sent via mail when the file inputfile.xls is loaded successfully?

2
  • Please stop using strings of periods to chain together parts of sentences. That isn't how proper English is written. Commented Aug 28, 2012 at 19:03
  • Thanks meagar, From next time definitely I will follow it. Commented Aug 28, 2012 at 19:26

2 Answers 2

1

The first option would be to use cron, but from your question it doesn't seem that you want to go that path.

My question would be, what is creating the *.xml file? Is it possible that whatever is creating that file to know when its finished and then calling the shell script, or better yet, have the xml file streamed to the shell script on the fly?

Sign up to request clarification or add additional context in comments.

7 Comments

*.xls file is my raw file that I load it manually everytime to my remote server..... through ftp>put inputfile.xls (to that /home/pkawar/folder/ipfile, where there is no other files before)...
so, you have a script that fetches the file from ftp automagically? Then you should be able to have that script know when the transfer is finished and then invoke the processing script. how are you scheduling the ftp pull?
ftp pull is not time dependent....it has to be fired at any time. It can be morning to evening any time...
So, you're manually pulling the file? Write a script that does the pull using curl/wget, and when it's complete have it call the processing script. Schedule using cron if you want to automate it further.
You've officially confused me. Here's what I'm hearing: * A file is FTP'd to a location "somehow", probably by hand * You run the processing script against that file * You don't have access to pull the file from any other machines? That shouldnt matter, you should be able to do this all in one script, even if you have to use ftp and autodrive it with commands in script. * Yes, you can automatically send email with the results. I don't understand where the problem is, you have access to the machine that gets the xml file, you have access to the processing script, what am I missing?
|
1

The first thing you should do is write a script that does whatever it is you want done. If your script performs correctly, you can use cron via a crontab file to have the script executed on whatever schedule you desire.

See man crontab for details.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.