Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan 61 posts 185 karma points
    Aug 10, 2015 @ 09:15
    Dan
    0

    scheduled-tasks certain time at 2pm

    Hi umbraco forum I know of the scheduler in umbraco https://our.umbraco.org/wiki/install-and-setup/scheduled-tasks

    but how do I set the scheduler to run every day when the time is 2pm and not ever 60 secounds ?

  • Carl Jackson 139 posts 478 karma points
    Aug 10, 2015 @ 11:45
    Carl Jackson
    0

    I don't think you can set scheduled tasks at specific times.

    You can do something in code which only executes if the time is correct and let the schedule task run every 60 seconds.

    https://our.umbraco.org/wiki/how-tos/run-the-scheduler-at-certain-times

    or Set the schedule to 86400 seconds and accept it will just run once every 24 hours but based on the app pool start time.

    Or.... use a windows scheduled task if you have access to do this which hits the URL at the given time specifically.

    Thanks

    Carl

  • Dan 61 posts 185 karma points
    Aug 10, 2015 @ 13:30
    Dan
    0

    Thanks for the reply Carl I was hoping that it wouldn't be this answer Ill get.

    I already set the time to 86400 seconds so it only runs once but how would you start the app pool at a certain time and if the site should go down and I would have to restart the server then would the app pool reset as well ? this sounds like a bad idea.

  • Carl Jackson 139 posts 478 karma points
    Aug 10, 2015 @ 15:03
    Carl Jackson
    0

    No - relying on the app pool being started at a specific time isn't the way to go.

    What is in the page / controller that you want to be hit?

    If you can't setup a scheduled task in windows then the best way is to allow your code to be hit every 60 seconds and then check the time when it happens.

    The server load will be unnoticable as the task you will do is only run when the criteria is met, otherwise nothing happens.

    Post where your code is running (in template, API, Controller?) and i can point you in the right direction.

    Thanks

    Carl

Please Sign in or register to post replies

Write your reply to:

Draft