Sitecron

  0 rating
6/24/2015 4:07:06 PM
7/20/2019 1:05:38 PM
Source: GitHub
Provider:

About


"Quartz.NET is a pure .NET library written in C# and is a port of very popular open source Java job scheduling framework, Quartz."

Add your scheduled jobs at /sitecore/system/Modules/Sitecron

You can get more information about the Cron triggers and examples from Quartz Scheduler website at: http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/crontriggers.html

Sitecron comes with a sample script called SampleLogJob which logs an info log entry based on the schedule you set. Make sure any implementations of schedule jobs inherit Quartz.IJob.

Thank you for using Sitecron. The documentation is available for download.


For help with Cron Expressions you can use http://www.cronmaker.com/

You can now install it from NuGet: https://www.nuget.org/packages/SiteCron/

Documentation

Documentation
  • Documentation > SiteCron
    SiteCron
    Install SiteCron using the package intaller. The module will initialize along with the Sitecore instance.

    To utilize the module you would need to build one or more classes which implement the Quatz.IJob. Once implemented, you can add a Cron job at /sitecore/system/Modules/Sitecron.

    Set the type as such:
    Class Namespace, Library

    Set the CronExpression, below are a few examples:

    ExpressionMeaning
    0 0 12 * * ?Fire at 12pm (noon) every day
    0 15 10 ? * *Fire at 10:15am every day
    0 15 10 * * ?Fire at 10:15am every day
    0 15 10 * * ? *Fire at 10:15am every day
    0 15 10 * * ? 2005Fire at 10:15am every day during the year 2005
    0 * 14 * * ?Fire every minute starting at 2pm and ending at 2:59pm, every day
    0 0/5 14 * * ?Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day
    0 0/5 14,18 * * ?Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day
    0 0-5 14 * * ?Fire every minute starting at 2pm and ending at 2:05pm, every day
    0 10,44 14 ? 3 WEDFire at 2:10pm and at 2:44pm every Wednesday in the month of March.
    0 15 10 ? * MON-FRIFire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday
    0 15 10 15 * ?Fire at 10:15am on the 15th day of every month
    0 15 10 L * ?Fire at 10:15am on the last day of every month
    0 15 10 ? * 6LFire at 10:15am on the last Friday of every month
    0 15 10 ? * 6LFire at 10:15am on the last Friday of every month
    0 15 10 ? * 6L 2002-2005Fire at 10:15am on every last friday of every month during the years 2002, 2003, 2004 and 2005
    0 15 10 ? * 6#3Fire at 10:15am on the third Friday of every month
    0 0 12 1/5 * ?Fire at 12pm (noon) every 5 days every month, starting on the first day of the month.
    0 11 11 11 11 ?Fire every November 11th at 11:11am.
    0
Back
Release notes
Version 1.0 released
Read more Back
Code examples
  • Code examples > Sample Class
    Sample Classes


    using Quartz;
    using Sitecore.Diagnostics;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;

    namespace Sitecron.Samples
    {
        public class SampleLogJob : IJob
        {
            public void Execute(IJobExecutionContext context)
            {
                Log.Info("Sample Log Job - Add Log Entry.", this);
            }
        }

    }


    using Quartz;
    using Sitecore.Diagnostics;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace SampleJob.Parameters
    {
        public class TestParams : IJob
        {
            public void Execute(IJobExecutionContext context)
            {
                JobDataMap dataMap = context.JobDetail.JobDataMap;

                string jobParams = dataMap.GetString("Parameters");

                Log.Info(string.Format("Instance {0} of TestParams Job - {4}Parameters: {1} {4}Fired at: {2} {4}Next Scheduled For:{3}", context.JobDetail.Key, jobParams, context.FireTimeUtc.Value.ToString("r"), context.NextFireTimeUtc.Value.ToString("r"), Environment.NewLine), this);
            }
        }
    }

    0

Solution screenshots(0)

Upload

Reviews (0)

Sort by: Date Most votes
  • Profile Avatar
    [fullName]

    Level: 0

    x0 x0 x0

    [date]

    [title]

    [text]

    Was this helpful?

    0

Comments (0)

Sort by: Date  Most votes

Leave a Comment

Comment must be field in
Post comment
loader

Write a review

Title can't be empty
Review can't be empty
Post review

Download

Title Description Download Action

Add File