Unix coding for triggering informatica


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Unix coding for triggering informatica
# 1  
Old 12-06-2011
Unix coding for triggering informatica

Hi,

I have very little knowledge with unix and pmcmd. I need help with a issue.

I have to see whether a file has been dropped in a particular location/path. If the file dropped I have to check the last modified time, which should be greater than 8pmEST the prior day. If the file has been dropped with time greater than specified, then the workflow should run and store the sysdate time stamp.
If errors skip and proceed the next job.
if the file did not drop then skip processing the load.

Can anybody help with the shell script..
Thanks in advance
# 2  
Old 12-09-2011
A more portable solution via perl:
Code:
#!/usr/bin/perl

use POSIX qw(strftime);
my $file = shift @ARGV;
stat $file;
die "File $file does not exist or cannot be read: $!"
  unless -f _ || -r _;
die "File $file cannot be stat'd: $!"
  unless stat _;

# Calculate in seconds the time it was yesterday (24 hours ago) at 7pm.
my $_7pm_last_night = ( strftime "%s",(0,0,19,(localtime(time - 24*60*60))[3..8]));

# compare the file's mtime timestamp with that time and exit accordingly
exit ( (stat(_))[9] > $_7pm_last_night  ?  0  : 1 );

# exits with 0 if the file exists and has been updated since 7pm, 1 otherwise


Last edited by otheus; 12-13-2011 at 12:53 PM.. Reason: first version didnt work
This User Gave Thanks to otheus For This Post:
# 3  
Old 12-12-2011
Hi,
I work on sun solaris and it is not very flexible.
it does not give mmin. it can only do mtime and -newer. it can only compare date.. which makes my job much tough.
# 4  
Old 12-13-2011
my script wasn't right at all.

I've updated it with your requirements.
# 5  
Old 12-13-2011
I know enough about Informatica to know that the Workflow software is mind-bogglingly complicated. Unless there is an Informatica guru on this board, I suggest that you approach Informatica through you support contract ($$$).
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Triggering UNIX Script from a JAVA program

Hi I am trying to implement one program, where JAVA needs to trigger the backend UNIX script. Tried with options like String cmdArray = {"/bin/ksh","-c","/SCRIPT_ABSOLUTE_PATH/sampleScript.ksh /FILE_ABSOLUTE_PATH Test_File.dat TEST E SFTP"} When I trigger the script from front end with... (1 Reply)
Discussion started by: karumudi7
1 Replies

2. UNIX and Linux Applications

UNIX help with informatica

Guys, I have a requirement.Please suggest the way i can : A script is being used to generate a file and send a mail to a source team if the feed for informatica jobs have not reached the server. If the file has not reached the server,the informatica jobs touch 0 byte file after 3 hours and... (2 Replies)
Discussion started by: aliva Dash
2 Replies

3. Shell Programming and Scripting

UNIX script to check file and start the informatica server

Hi Rockers, I hope u r dng good one. I have a one question is in unix with informatica . I need a unix script to check whether particular file exists in the folder , If it means we have a informatica server , so we can start the informatica server by accessing that file. Every week we have... (0 Replies)
Discussion started by: gurukrishnan
0 Replies

4. Solaris

Triggering UNIX command from Web Browser

HI, I want to trigger a UNIX command from a web browser page. The web browser will have few steps which will generate the UNIX command and then it should connect to the UNIX box and fire that command. Here we are using Sun Solaris UNIX. Can you please suggest me how can i get... (6 Replies)
Discussion started by: dear_abhi2007
6 Replies

5. UNIX for Advanced & Expert Users

automation of Informatica jobs using Unix

1.How will you do automation of Informatica jobs using Unix ? 2. How u run workflow from Unix? :) (2 Replies)
Discussion started by: kamesh83
2 Replies

6. UNIX for Dummies Questions & Answers

Call unix script through informatica mapping

hi, i want to call unix script from transformations used in informatica mapping? can we do it in any way? Please reply ASAP. We cant use Storep procedure transformation Thanks in Advance nishith (0 Replies)
Discussion started by: Nishithinfy
0 Replies

7. Shell Programming and Scripting

Triggering my Unix script....

Hi All, i dont have any idea about perl scripting... i need some suggestion so that i can put my effort to find out the solution:D let me explain....one of my tedious task which will taken care by Unix shell script which i prepared. its a kind of routine work that i am running the... (4 Replies)
Discussion started by: Shahul
4 Replies

8. UNIX and Linux Applications

Informatica - Unix Problem

hi guys, I have to ftp an empty text file dim_trigger.txt form 1 server to another. The target server is mtiftp and i have defined the username and password. Below is the shellscript thats in a file called dim_trigger.ksh #!/bin/ksh # # FTP Bo trigger # HOST= 'mtiftp' USER=... (0 Replies)
Discussion started by: fgene1
0 Replies

9. Windows & DOS: Issues & Discussions

Urgent Need for Assistance: Triggering Windows bat files from UNIX

Hello, Is there a way to trigger a Windows bat file or program on a different machine from a different UNIX server using KSC file? I hope you can assist me with this. Thanks! (0 Replies)
Discussion started by: punyenye
0 Replies
Login or Register to Ask a Question