I recently found that LINQPad can execute shell commands. Can someone show me an example how to use LINQPad queries to execute batch job?
Sorry I didn't make my question clear. What I mean is make .linq file become my batch file. That is, schedule a batch job written in .linq file and use LINQPad as the command to execute it.
Just call the batch file using the shell execute command:
Util.Cmd (#"c:\batch\MyBatchFile.bat");
Related
I wanted to know how can I set an variable from shell job available in pentaho kettle, which can be accessible by further Jobs(Simple evaluation) in the workflow.
I am trying to create a workflow where I have a start element which would trigger as shelljob to check the folder presence, if the folder is present then set one variable. The next job is Simple evaluation which needs to check if the variable(Set by shell job) is true that proceed with the workflow or terminate the workflow.
Start-->ShellJob(check folder created and set variable)-->SimpleEvaluation Job.
--MIK
Good question. I'm not aware of such capability, as the "Execute a shell script..." step isn't designed to be a data pipeline. Furthermore, what values should/can a script return to you? Is it the result of an echo? A shell script could essentially be anything. I would say there's a reason why there is no built-in functionality for that in PDI.
Having said that, what you could do is something like this:
Execute a script, at the end of it write the variables into a text file on the file system
Create a sub-transformation that reads the variables from the file you've written in the shell script step, and then stores it/them in global scope variable
Evaluate the variables in the job
It may seem a bit cumbersome, but it should do the job for you, since you're asking to use the Shell Script step in a way it's not really designed to be used.
Here's an example of a high-level implementation (implementation of the sub-transformation should be very simple):
I hope it helps.
I have multiple PowerShell script files that I need to execute in a sequential flow(one after other). Can someone please help me how to schedule multiple PowerShell files to be executed using a SSIS Package. And I need to build a fault tolerant model were I need to re-execute a powershell script in case of failure.
Running PowerShell
There isn't a built-in Execute PowerShell task (pity) so you'll need to use an Execute Process Task with the path to powershell.exe
Something that you will need to take into consideration is that the default execution policy for PowerShell is Restricted which cannot run a script. Further complicating matters is the account that runs the SSIS package will also need to have its execution policy modified to be able to fire off those scripts. It's a simple matter of Set-ExecutionPolicy RemoteSigned or whatever level you feel is appropriate but you'll need to do this from within the account.
Fault Tolerance
The simple approach is to ignore the return code in the Execute Process Task. Alternatively, if the desire is to keep running the PS1 until it doesn't fail, then you'd wrap a For Loop Container around the Execute Process Task and only set the terminal condition once the task returns a success value. Things might still go sideways depending on what the failure is.
I have a batch file which will execute some .exe which do some operations (like connecting to DB, fetching data, insert data etc...)
All the things are configured in the batch file and when I run it, it works good.
But, I want to invoke this batch file from a PL/SQL procedure.
this procedure should invoke this batch file first, and after the execution of the batch file, it will have it's own SQL operations.
How can I proceed to do this?
Set up a job with dbms_scheduler. This topic is discussed here (German):
http://db-memory.blogspot.ch/2012/12/dbmsscheduler-mit-executable-unter.html
The screenshots may be helpful.
Please remember to enable the dbms_scheduler job, else it won't run.
You can write your own stored java class with a method which implements running an OS executable file. You should grant to your oracle user java.io.FilePermission and java.lang.RuntimePermission with DBMS_JAVA.GRANT_PERMISSION procedure. Then you should create a plsql function-wrapper which calls your java method. And all you should do for running an OS eecutable is to run your plsql wrapper function.
There is an "AskTom" page about it here
i have an access database backend that contains three tables. i have distributed the front end to several users. this is a very simple database with minimal functionality. i need to import certain rows from a file every hour into one of the tables in the database. i would like to know what is the best way to automate this process so that i can have it running hourly. i need it to be running sort of as a service in the background. can you tell me how you would do this?
You could have for example:
a ms-access file with all necessary code to run the import proc
a BAT file containing the command line(s) that will run this ms-access file with all requested parameters. Check ms-access command line parameters to see the available options.
a task scheduler service software to launch the BAT file: depending on the task scheduler and the command line to be sent, you could even avoid the BAT file step
If all you want to do is run some queries, I would not do this by automating all of Access, but instead by writing a VBScript that uses DAO to execute the SQL directly. That's a much more efficient way to do it, and will run without a console logon (which may or may not be required for full Access to be run by the task scheduler).
i want to execute SubWCRev.exe in msbuild to check for local modifications .if local modifications found then i want to display message on command prompt.
please tell me how can i use this.
thanks
Using MSBuild Exec task you can't get the output, so you'll have to write an MSBuild custom task to do that (Or an inline task if you are using MSBuild v4).
In that task you'll execute SubWCRev.exe, parse the result and set it to an output property.