GPSPOW
asked on
Creating an event trigger for a scheduled task on Windows Server 2008 R2
I have a scheduled task that currently runs every night at 3 AM. I want to add an event trigger that will allow the task to run if a condition is met.
The task copies files with monetary transactions to specific folders. I will have a text file that designates whether or not the amounts are in balance. If the text file value is set to "Y" then the files are to be copied otherwise an email will be sent notifying the recipients of the out of balance condition.
How can I do this?
Thanks
Glen
The task copies files with monetary transactions to specific folders. I will have a text file that designates whether or not the amounts are in balance. If the text file value is set to "Y" then the files are to be copied otherwise an email will be sent notifying the recipients of the out of balance condition.
How can I do this?
Thanks
Glen
so you will have two amounts in this text file, somewhere, and if they are the same you want X and if they are not the same you want Y? Can you post the text file so we can see what we need to search for?
ASKER
Attached is an example of the "csv" file that will be generated. The column "InBal" has a "N" value.
If this value is "Y" then I want the task to run. If the value is "N" then I need to send an email reporting the out of balance condition. I will use the fields within this file:
OPSATB, SPATB etc. as data within the email.
Let me know if you need anything else.
Thanks
Glen
CroweMsg.csv
If this value is "Y" then I want the task to run. If the value is "N" then I need to send an email reporting the out of balance condition. I will use the fields within this file:
OPSATB, SPATB etc. as data within the email.
Let me know if you need anything else.
Thanks
Glen
CroweMsg.csv
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Here is the batch file that runs if the "InBal"="Y"
net use D:\DTS
copy D:\DTS\DailyATB\Daily_ATB_ Test.txt "\\pmcfs\groups\Accounting \CHI\Daily ATB\rca_p1 _mt_daily_ accts_"%da te:~10,4%% date:~4,2% %date:~7,2 %".csv"
copy D:\DTS\DailyBD\DAILY_ATB_B D_XFR.txt "\\pmcfs\groups\Accounting \CHI\BadDe btData\rca _p1_mt_bd_ transfers_ "%date:~10 ,4%%date:~ 4,2%%date: ~7,2%".csv "
copy D:\DTS\DailyTXN\DAILY_ATB_ TXN_DETAIL .txt "\\pmcfs\groups\Accounting \CHI\Daily TxnData\rc a_p1_mt_da ily_txn_"% date:~10,4 %%date:~4, 2%%date:~7 ,2%".csv"
copy D:\DTS\DailyNPA\DAILY_ATB_ NPA.txt "\\pmcfs\groups\Accounting \CHI\Daily NPA\rca_p1 _mt_daily_ npa_"%date :~10,4%%da te:~4,2%%d ate:~7,2%" .csv"
net use D:\DTS /DELETE
If "InBal" ="N" then:
Recipient: gpspow55@gmail.com
Sender: gpowers@stlukeshealth.org
Subject: Daily ATB Files Not In Balance
Message: "Text lines" and then list:
"OPS ATB:" OPSATB value
"SP ATB:" SPATB value
... all other values.
Thanks
Glen
net use D:\DTS
copy D:\DTS\DailyATB\Daily_ATB_
copy D:\DTS\DailyBD\DAILY_ATB_B
copy D:\DTS\DailyTXN\DAILY_ATB_
copy D:\DTS\DailyNPA\DAILY_ATB_
net use D:\DTS /DELETE
If "InBal" ="N" then:
Recipient: gpspow55@gmail.com
Sender: gpowers@stlukeshealth.org
Subject: Daily ATB Files Not In Balance
Message: "Text lines" and then list:
"OPS ATB:" OPSATB value
"SP ATB:" SPATB value
... all other values.
Thanks
Glen
And this work as is--you have tested this batch file (because there seems to be nothing to send the email to me)?
ASKER
I think I get the gist of what I need to do with the existing batch file I have been using to create files unconditionally. I will put it in the :yes section and test to see if it will run with the conditions.
Thanks
Glen
Thanks
Glen
OK but let me know if you can't get it to work.