36

Purpose of keepalive.aspx Here's the full code of the page in Sitecore 8.0: <%@Page Language="C#" %> <%@ Import Namespace="Sitecore.Analytics" %> <!DOCTYPE html> <html> <head id="Head1" runat="server" enableviewstate="false"> <title>Keep Alive</title> <script runat="server"> protected override void ...


13

This can be achieved by updating your Schedule field on your task. 127 represents the days of the week, this task is meant to run. This only makes sense if you convert it to binary. 127d = %01111111 Each of the bits represent a day of the week. Like this. -SFTWTMS 01111111 So to disable the tasks for the weekend, change it to: -SFTWTMS 00111110 %...


12

Definitely - all Sitecore does when reading in your agents is parse the interval as a TimeSpan via the following line of code, from the Sitecore.Tasks.Scheduler.ReadAgents method: TimeSpan timeSpan = DateUtil.ParseTimeSpan(XmlUtil.GetAttribute("interval", configNode), TimeSpan.FromSeconds(0.0), CultureInfo.InvariantCulture); The Sitecore.DateUtil method ...


12

Adding to Dmytro's answer - indeed the KeepAlive.aspx serves to keep a heartbeat running. While in most cases this is the equivalent of setting the idle session timeout to 0, there are cases where you could end up with a shutdown of the Asp.Net worker process - idle timeout or keepalive alike. Your worker process may terminate due to a number of reasons, ...


11

I personally think the KeepAlive page is there for people who don't understand or haven't bothered to tune their IIS application settings. Even with the KeepAlive page, if your site sits idle for 29 hours it's going to turn off if you haven't touched those default settings. That may be a problem if you have a Job Server that never fields requests. So, it ...


10

I don't know that your question needs more than 4 answers, maybe you've got what you wanted, but I do have another aspect not previously mentioned :) -- so let me add yet another answer. The KeepAlive.aspx page is also used for extending active sessions in the Sitecore Client (and prevent a timeout from spoiling a long duration form edit for a content ...


8

I would suggest switch to Database Tasks (/sitecore/system/Tasks/Schedules/), it has out-of-box mechanism to handle scheduled tasks for load balanced environments. The benefit you will have is, it will get invoked only from one of multiple sitecore instance (whatever instance gets first chance) as it maintains state (flag) of Last Run. For example, if the ...


8

It's not possible to run at exactly the same time but it’s possible to get it close to the same time every day. Scheduled tasks are run in sequence by the Sitecore scheduler. The scheduler checks within a certain interval (defined in the web.config in the /scheduling/frequency and /scheduling/agent settings) for tasks to be run. If a task is over due, it is ...


7

The scheduled task is going to be a tool used to execute code you've written. There are ways to create custom commands in C# or use the existing on that is included with Sitecore PowerShell Extensions (SPE). For simplicity, I'll show you how to do that in SPE. Here's a really good section in the book covering the creating of task scripts. Examples In this ...


7

You can try the Sitecore Log Analyzer. You can filter by timeframe and add a string qualifier and look for Job started/ended statements in the logs.


6

This is the reason it's there yes, it is so: Scheduled tasks run as expected, even when traffic is low / non-existent There is no delay hitting the site if the application pool has recycled - so no building up caches etc. Could you achieve the same thing with setting the application pool idle timeout to 0? Technically, I suppose you could - I've been ...


6

Config based tasks will run on the server that it is configured to run on by the presence of the task in its config. In a load balanced CM environment, if you have a config task that you only want to run on 1 CM server, then have it only show up in the config on one of the servers. Okay, that's the easy way but what if one of the CM servers goes down? You ...


6

Besides what has been mentioned on the other answers it can be useful if you have a load balancer and you want to configure a page where the load balancer can ping sitecore to know if the node is up or not. It can be done with other pages yes but I generally use this one


6

In the previous question you gave an excellent description on what a Hook is. 1. How are Scheduled Tasks different from Hooks? Hooks are specific pieces of code that are loaded into the worker process and generally attach to some sort of event that occurs in the system. One of the most common events that Hooks utilize is the HeartBeat static class which in ...


6

Disable your default publishing in web.config <agent type="Sitecore.Tasks.PublishAgent" method="Run" interval="00:00:00"> Override Sitecore.Tasks.PublishAgent <agent type="YourMethod, YourClass" method="Run" interval="01:00:00" ><br> <param desc="source database">master</param> <param desc="target database">...


6

Your class needs to be non-generic. I recommend inheriting from BaseAgent. Right now, Sitecore can't instantiate your class. I don't know exactly how your class is defined, but I know it has a generics component to it, based on this line of code. System.Data.DataTable dataTable = new System.Data.DataTable(typeof(T).Name); T would be the generic component ...


6

This is a normal behaviour in Sitecore, you need to add agents for schedule task on CD. You need to add in your config files : <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <!-- adjust the value according related infrastructure --> <sitecore> <...


5

If a trick with security disabler will not work you could try this $admin = [Sitecore.Security.Accounts.User]::FromName("sitecore\some_admin_account", $false) [Sitecore.Security.Accounts.UserSwitcher]::Enter($admin) # YOUR CODE HERE [Sitecore.Security.Accounts.UserSwitcher]::Exit()


5

Here is a low complexity example using Sitecore PowerShell Extensions. Make sure that the SPE Remoting Module files are saved to a path configured in $env:PSModulePath. Save script to desired path: Import-Module -Name SPE $session = New-ScriptSession -Username "admin" -Password "b" -ConnectionUri "http://remotesitecore/" Invoke-RemoteScript -ScriptBlock { ...


4

The built-in Sitecore scheduler can certainly be frustrating in its limitations. So using a WebApi endpoint that the task can call is certainly one way of doing things. You should keep security in mind though; if your URL can easily be guessed and doesn't require authentication then anonymous users can potentially trigger it. You should definitely ...


4

An alternative to using .net code or storing logs in the database: We used the forfiles command for things like this. Place the command(s together) in a batch file and have that executed as a scheduled task on the server. Works fast and puts no extra load on your .net application. You can delete files with it (based on date), adding zip functionality (e.g. ...


4

You cannot. When Sitecore executes any job, it runs <job> pipeline defined in Sitecore.config (or web.config in older versions). This pipeline has SignalStart and SignalEnd processors, but the only thing they do is logging the information that job started or finished: public static void SignalStart(JobArgs args) { Job job = args.Job; job.Status....


4

If you don't want to install SPE module like @Michael West suggested, there is another way to do this. You can implement a custom class for your agent and add it to schedule with a config patch. A config patch to add your class to the schedule can look like this: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> &...


4

I believe that you are reading too far into John's details. If you have a task that you need to run on some schedule, you can create a Sitecore Task Command item, which contains the Type to your custom code that you want to execute. Then you create a Sitecore Task Schedule that will run that Command on a schedule. You do all of that through the Sitecore ...


4

The autopublisher is an agent that is disabled by default. You will find it in the config: <agent type="Sitecore.Tasks.PublishAgent" method="Run" interval="00:00:00"> <param desc="source database">master</param> <param desc="target database">web</param> <param desc="mode (full or smart or incremental)">incremental&...


4

First things first - You shouldn't extend templates this way. Best practice is to set inherited (in your case OOTB) template as base template to your custom template and add your custom fields. You can set in in Builder -> Base Templates on your custom template. You can inspire by /sitecore/templates/System/Content Testing/Tasks/Rebuild Index Command ...


3

It sounds like you are running into a permissions issue. You could try wrapping the whole script in a security disabler like this: New-UsingBlock(New-Object -TypeName "Sitecore.SecurityModel.SecurityDisabler"){ # Add your script here } That should prevent any permissions issues.


3

Since you did not provide any context of the task, let's say that you have a task which needs to update the fields of Sitecore Items. So, when the time comes, the task will trigger the code and the method you provided and it will be something as below: public void Run() { var items = Factory.GetDatabase("master").GetItem("Path or Id here").Children....


3

If the different domains map 1 to 1 with a site node and those site nodes have different root paths then this should help. You should be able to make an extension method that finds the context site based on the root path like the following: public static SiteInfo GetSite(this Item source) { return Factory.GetSiteInfoList().FirstOrDefault( site =>...


3

You can use next code to stop a Sitecore job : Sitecore.Jobs.Job job = Sitecore.Jobs.JobManager.GetJob("yourjobname"); if (job != null) { job.Status.State = Sitecore.Jobs.JobState.Finished; job.Status.Expiry = DateTime.Now.AddMinutes(-1.0); } I used jobviewer from your link ...


Only top voted, non community-wiki answers of a minimum length are eligible