How do I run cron jobs in wpmudev hosting?

I use caching plugins on my servers and run cron jobs for deleting files and running other site specific jobs. I logged into ssh on hosting platform and it tells me crontab is disabled. How to run cron jobs?

  • Kasia Swiderska
    • Support nomad

    Hello Lee,

    I apologize for the misunderstanding. I've asked our sysadmins about your request and we are not supporting custom cronjobs outside WP.
    They also added that deleting cache files can be done via PHP/WP plugin code and for that WP cron will work.
    Hope that helps

    kind regards,
    Kasia

  • Lee
    • Syntax Hero

    thanks for the reply but i use cron jobs to manage many things on other servers. Additionally the cache plugin i use recommends cron jobs to fine tune and manage exact cache clearing. so dev is wrong and you need to support cron.

  • Lee
    • Syntax Hero

    Looking at plugins to do cron doesn't give any good options at this point on wordpress.org. All very old except one and not sure how to use it. Advanced Cron manager. Any suggestions other than setup an outside of wpmudev hosting server to do url calls?

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hey Lee ,

    I'm not entirely sure what you're trying to achieve regarding the file functions you want, but since we have crons running on 5min interval you could basically script anything within a normal scheduled event in WordPress to run any php commands you like as well.

    That doesn't need any Cron plugins at all.

    For some reference:

    To create a cron event ( scheduled event ) you can use the wp_schedule_event() to run any code you like, https://codex.wordpress.org/Function_Reference/wp_schedule_event

    To retrieve or send data to other pages ( the cURL you mention ) you can use the internal wp_remote_get() / wp_remote_post(), https://codex.wordpress.org/Function_Reference/wp_remote_get

    And if the files are native you can also utilize the Filesystem API ( https://codex.wordpress.org/Filesystem_API ) or normal PHP even if you feel more comfortable.

    That being said, I don't see a strict need of using 3rd party cron planners or "external" cron scheduling since everything is on the same file-system and accessible already.

    Since you mentioned the "non wordpress cron" already, I have to say that WP Cron is just a crontab alternative that runs PHP code or anything else you like basically as long as there's a scheduled event for it, so you can surely run "non wp code" within WP itself.

    Tell me if you need further help or need more clarifications.

    Regards,
    Konstantinos

  • Lee
    • Syntax Hero

    not a programmer.

    use cron to run specific urls to activate plugins that require cron tasks. so non wordpress cron task are run by server and i run 5, 15 ,20, 30, 45, 60, 12hr 24 hr tasks. and on a single server i stagger 6, 11, 16 etc multiple domains.

    so yes us non programmers need an easy straight forward way to run a task any minute of the day

    • Konstantinos Xenos
      • Rubber Duck Debugger

      It is a managed hosting solution so server access is limited as we need to maintain the systems to run in top shape and highest performance possible regarding the resources given and how system handles itself in general. On an extra note as far as I'm aware none of the Managed hosting solutions out there give access to server-side cron for their members to use at will.

      This is also why we've made sure to run a dedicated cron event for WP every 5 minutes so none of the events gets missed.

      If there are plugins already within WordPress then there shouldn't be a need to fetch their URLs via external cron events to do their job as they should already be using WP Cron either way and use all available built-in methods that WordPress provides automatically or give you an option via WP Admin to choose what you want to do and when for their options & scheduled tasks.

      In any case, I will ask our Sysadmins if there's a possibility to add server-side cron events on demand, but I can't make any promises on that due to the above mentioned reasons.

      Regards,
      Konstantinos

    • Konstantinos Xenos
      • Rubber Duck Debugger

      Let me explain what the 5 minute is because you've misunderstood it.

      WP Cron is using a built-in WordPress "cron event like" system to accommodate the plugins/themes/update and all other events needs etc.

      WP Cron's clock gets updated each time your website has a visitor. This means that websites that don't have enough visitors within a day might have some cron events missed.

      This is why we've set up a 5 minute interval to "activate" WP Cron every 5 minutes ( like having a user visiting your page ) and that will ensure all WP Crons to run properly on their supposed time.

      This 5 minute has nothing to do with "when" the actual tasks are run. You can have events hourly,daily,twicedaily, or on any other interval you like as with normal cron jobs.

      The 5 minute ping is just there to make sure that those events will fire on time by keeping the internal clock updated always.

      Regards,
      Konstantinos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.