I have a small program that I would like to turn into an installable windows.form. It needs to automatically be run as a cron job/scheduled task. How can I do this?
C#
You can either have it setup as a Windows Service or the at command can run it as a scheduled task.
http://support.microsoft.com/kb/313565
Related
I have setup Jenkins to automatically build my Maven project. I would like to extend the same to automatically create database tables if they dont exist. Can this be done via jenkins? i.e. Can the Jenkins job be modified to have an additional pre-build step of creating database tables? If so, can anyone give me any pointers as to how to do this?
if this is not possible directly in Jenkins, can this be done via Maven? i.e. modify the Maven build to create the tables before compiling the code.
Any help will be useful. Thanks in advance!
You could use the sql maven plugin to execute sql-scripts or define pre-build steps in the jenkins job.
See this similar question for more tips...
If you prefer not to use maven but a jenkins solution I would add a 'pre-build Step' or a 'Build-Step' (depends on your job-type) of the type 'Execute Shell' or 'Execute Windows batch command' and call the corresponding command line tool of your database (in this case MySQL Command-Line Tool).
The command line tool must be installed on the jenkins server or must be included in the project checkout.
As a solution, I used a separate Jenkins Job to run the SQL script via the Jenkins command line tool interface.
I have automated build and deploy process in TFS by referring to http://www.codeproject.com/Articles/790206/Deploying-Web-Applications-using-Team-Foundation.
After deployment I am validating deployed application by running selenium scripts via batch file by mentioning the path in "post-test script path". Its executes the batch file and runs automated tests.
Now, I wanted publish these selenium results. So I have created jenkins jobs with email configured. So how to execute this job post deployment. I have tried by providing jenkins job trigger email in "post-test script path", but it actually looking the path and throughs an error. So how to execute jenkins jobs post deployment.
Also, I am trying complete automation process, where it automatically build, deploy and run some selenium tests using TFS. If any body has better process please let me know. Thanks
You can use the Command Line task in the new TFS 2015/VSTS build system to easily execute selenium tests.
You can then easily configure and pass variables.
I would also recommend that you move to using release management tools for deployment. While a CD makes sense for development it is often not viable for a release pipeline and you need more meta data and approvals.
You can do this with the release management tools that come with TFS 2013+.
I have a Requirement where i have to run a SQL Script in SQL server on a weekly basis .Result of this script has to be mailed.I want to automate this process.I don't want to go with SSIS Jobs. I have searched i have found few options like Creating a Windows Scheduler task to invoke a SQLCMD.Can Someone Assist on how to create Scheduler task to invoke SQLCMD
Your best bet would be to create a Console Application which executes the SQL Command and performs the email.
You can then use setup a task under Task Scheduler to use the Start a program option and run it on the schedule you prefer.
sqlcmd is just a command line tool. Put your SQL in a script file, and call it from the tool with right DB server and credentials. We can help you to figure how to make it work if you have a specific problem, but you should make your own tries before and tell us what goes wrong.
You will easily find examples on how to run a script :
http://msdn.microsoft.com/en-us/library/ms170572.aspx
More details on parameters :
http://msdn.microsoft.com/en-us/library/ms162773.aspx
example :
sqlcmd -S myServer\instanceName -i C:\myScript.sql -o C:\EmpAdds.txt
For task scheduler, it's easy to use but beyond SO scope, and it depends heavily of your version of windows, so (again), try yourself first.
Please note that you can also use SQL Server Agent to schedule your jobs.
I have a simple website built using PHP. It is hosted on a Linux server.
I need to run a PHP script every night. How do I do this?
Will an 'open-source job scheduler in java' be able to run a PHP script?
There are several possibilities.
If you have shell access to the machine you can set up a scheduled task (cron job, http://www.scrounge.org/linux/cron.html) to execute your script either by the php command line client or by a tool like curl or wget.
IF you don't have access to the shell on that machine there are several web sites that offer free cronjobs. Basically what they do is that you give them a link and the schedule when they should access your link. Just google for online cron job
Does anyone know if you can and how to start off a scheduled Windows task on a Remote Server from within a SQL Server Integration Services (SSIS) package?
Assuming you run it on Windows Server 2003/2008 or Vista, use SSIS Execute Process Task to start SCHTASKS.EXE with appropriate params (SCHTASKS /Run /? to see details).
It should be possible as the Task Scheduler has a scriptable COM API that can be used for interacting with tasks.
You could therefore either create a custom task that uses COM interop to call the Task Scheduler API, or it'd probably be quicker to use an Active X Script task to do your dirty work.
I invested a lot of time in the aforementioned COM API back in 2002. It was, to put it mildly, "flakey".
What we ended up doing instead is having our tasks run every minute. The first thing the task did was check the database to see if it should continue running or not.
Then "starting" a scheduled task from SSIS was as simple as changing a database field.