1826290 Members
4610 Online
109692 Solutions
New Discussion

Automating Process

 
Tony500
Advisor

Automating Process

This may be a long shot, I don't know the first thing about scripting or programming. Here goes.
I have a report writing tool called Intellegent Query (IQ) that I use to run a specific report after a user runs certain programs within the primary application used on our box. I need to find a way to make the IQ program run the report for the user without the user having to actually go through the process of running it manually. Then I need to have the result ftp'd to another machine. Is it possible to automate this process?
You can usually find me at www.constantreader.net
5 REPLIES 5
Zafar A. Mohammed_1
Trusted Contributor

Re: Automating Process

Pass those query inputs with the script and you can easily ftp also.
ftp -ivn << EOF
open hostname
user username password
do all your ftp commands here
..
bye
EOF

If you can send the example in detail with script then it will be easy for us to give more.

Thanks
Zafar
Shannon Petry
Honored Contributor

Re: Automating Process

I hope I understand what your asking. User runs a tool after an application, and you want the tool to run after the app automatically.

yes, definately possible.

I.E.

Your app launches with
/apps/stuff/myapp.bin

The tool is
/apps/stuff/mytool.bin

Make a wrapper script to launch both.
vi wrapper.sh
#!/bin/sh
/apps/stuff/myapp.bin $*
/apps/stuff/mytool.bin
# end of the line #

Then have the user launch the wrapper instead of the app and tool.

As for automagic FTP, that is definately possible. Just search the forums for automate ftp and I'm sure you will fine hundreds of pages to help you.

Regards,
Shannon
Microsoft. When do you want a virus today?
Mark Greene_1
Honored Contributor

Re: Automating Process

Check out the man page for "crontab". Your best bet is to create a script from which to run your report, and then call the report from cron.

Zafar already posted the details on the ftp. The script is the best way to setup your environment variables. When cron runs a process, it does not exectute the .profile for the login ID, so any special PATH requirement or environment variables particular to your report writer need to be created prior to running the report.

HTH
mark
the future will be a lot like now, only later
Tony500
Advisor

Re: Automating Process

Well, there is isn't actually a script. It's just a reporting tool that creates the report. Then I manually ftp the file that results.
You can usually find me at www.constantreader.net
Mark Greene_1
Honored Contributor

Re: Automating Process

"Well, there is isn't actually a script. It's just a reporting tool that creates the report. Then I manually ftp the file that results. "

Create a script. Just edit a file, stick "#!/bin/ksh" in as the first line, then add the command you use to run the report, then the ftp bit that Zafar posted. You should probably add a test to ensure that the report ran before ftp'ing it, may something like:

if [[ -f "filename" ]]; then

(ftp stuff here)

fi

where "filename" is the name of the file containing the report.

Then, you can run the script manually as well as have it run automatically from cron.

HTH
mark
the future will be a lot like now, only later