How to run Yii controller action In a particular time interval ? - yii

I want to run a Yii controller action in a particular time interval. So I used the Windows 7 task scheduler for performing this. But nothing happens. Is it possible to run the Yii controller action using Windows Task scheduler ?
If so what is the syntax for doing this?

You can implement this with crone jobs. Here are some links which will help you.
1.Implementing cron jobs with Yii
(check the comments there too)
2.Yii and cron jobs
3.Console Applications
4.Yii-Crontab - an extension(Manages system cron jobs. Supports Application console commands)
5.Runactions

Related

Splitting Jenkins Job to run concurrently

Does anyone know of a way to split a single Jenkins job into parts and run them concurrently/parallel?
For example if I have a job that runs tests which take 30 minutes, is there a way I can break this job into three 10 minute runs that run at the same time but in three different instances
Thanks in advance.
Create new jobs, call it f.e. Test . You should select the job type based on the type of the root job.
If you have a Maven Job type, you can set the workspace directory under build -> advanced. Freestyle Job type has this option directly under project -> advanced.
Set for all jobs the same working directory. The root job will compile and all other jobs uses the same working directory to use the compiled output.
For the test jobs add the test execution as build step and differ here the tests which should be executed.
Edit your root job and remove there the excution of the long running tests. You can call there the three jobs now. But you need the Parameterized Trigger Plugin.
The downside of this way, you need enough jenkins executors to handle all tests jobs.
If you're using Jenkins 1.x, I would suggest trying the multijob plugin - I've successfully used it to split a single job into a parent job plus multiple child jobs:
https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin
If you're using Jenkins 2.x, then try out the pipeline feature :) It makes running parallel tasks very easy:
https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md#creating-multiple-threads
If you want, I believe you can also use pipelines in Jenkins 1.x by means of a plugin. I haven't looked into that, though.

Automate Selenium Test cases using Windows Service

I have created a test automation solution using selenium webdriver. Now I want to execute them everyday at particular point of time . For this , I want to create a windows service which starts the tests execution without any input from my side. How should I proceed to achieve that.??
Thanks.
write a batch script that keeps on running and triggers your test everyday at particular time. Or a more professional way is to use Jenkins : )
or you can also use Scheduled Tasks a windows feature
For details on Scheduled tasks

Counting how many script in SSIS have been completed

In SSIS package i have multiple scripts running within a job. At any given time i want to read how many scripts have been executed eg, 5/10 (50%) have been completed. Please tell how can i achieve that?
Currently there is no such functionality provided by SSIS to track progress of package execution.
It seems you need to write your own custom utility/application to implement same or use third party one.
There are few ways to do -
Using a switch called /Reporting or /Rep of DTEXEC at the command-line . For example:
DTEXEC /F ssisexample.dtsx /Rep P > progress.txt
2.Implement package logging or customize it.
3 . Implement Event handler on required executable. You can also use OnPipelineRowsSent log of Data Flow Task.
If you want to write your own application then below thread will provide nice starting point.
How do you code the Package Execution Progress window in C#
In my experience, we are using another software to monitor the jobs that are running. http://en.wikipedia.org/wiki/CA_Workload_Automation_AE
You can also try to create your own application that runs on the background that checks that status of your jobs, through checking the logs.

Is there an Ektron Scheduler?

I need to have a process or widget that every five minutes will check to see if there are any xlf files in the localization folder, and if any exist, will import them into Ektron. Is there a way within Ektron to have something scheduled.
I don't think there is any scheduler program inside Ektron.
To schedule a task you could look at using one of the following:
Quartz.Net
Command line programs called by Task Scheduler
Alternatively, you could look at using an Ektron plugin, which will get fired when certain Ektron events occur (e.g. content published). However, in my experience plugins/extensions are poorly supported and documented.
You can try creating a Windows service to perform the scheduling.
Details on the localization API and how localization performed can be found at:
root\Workarea\controls\content\localization_uc.ascx.cs in your Ektron site.
I'd recommend trying something similar to what Ken McAndrew did for an alias scheduler. Details here: Manual Alias Scheduler

how to schedule a task in MVC4 C#?

I wanna create a notification system on my website?(something like stack-overflow)
How can we schedule a task for mailing the notification for users on each 24 hours?
Can we use MVC4 or we should use windows service ?
Edit:
My Experience with using FluentScheduler in 3 month within a MVC4 App .
FluentScheduler is easy to config and using but it doesn't run tasks any time. Sometimes run and sometimes doesn't run.
I think the best way for scheduling is Windows Service to ensure running a task at the specific time.
Found this to be an awesome scheduler, FluentScheduler
Usage:
// Schedule an ITask to run at an interval
Schedule<MyTask>().ToRunNow().AndEvery(2).Seconds();
You need a .Net Job Scheduler. Here is a good one: http://quartznet.sourceforge.net/
You can use ATrigger scheduling service. A .Net library is also available to create scheduled tasks without overhead. Errors log, Analytics, Tasks Listings and more benefits.
Disclaimer: I was among the ATrigger team. It's a freeware and I have not any commercial purpose.
maybe you wanna use a scheduled task. Doing this in a MVC is a bad idea (mixing responsabilities) and building a windows service looks like an overkill to me (because is something doesn't need to run all the time).
I use scheduled task of windows.
I have build a little app than enter a record in the bd, then access the website with this recordId(Guid) as a parameter.
In mvc i check if the id exist, if it exist i run tasks then delete the record in the db, if not i ignore it.
this way im able to add schedule with a param. without updating the app each time i need a new scheduled task. i just add a new task like
"myapp.exe /MyNewTaskName"
hope this help someone ;-)
First of all;
Add Nuget package Install-Package FluentScheduler
Add your registry class that inherit Registry and some code
// Schedule a simple task to run at a specific time
Schedule(() => System.Diagnostics.Debug.Write("This is from service " + DateTime.Now.Second+"\n"))
.ToRunNow().AndEvery(2).Seconds();
Register that registry class in Application_Start of Global.asax.cs
with TaskManager
TaskManager.Initialize(new Test());
GitHub
There is also a built-in option, QueueBackgroundWorkItem. It was added in .Net 4.5.2 and here is a guide on how to use it in MVC.
In addition to previously mentioned FluentScheduler you also have HangFire. And if you plan on deploying to Azure there's a handful of different services for this.