Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. WordPress (Developer)
  3. Create a custom cron

Create a custom cron

Scheduled Pinned Locked Moved Solved WordPress (Developer)
cronclear cachewp rocket
5 Posts 4 Posters 1.2k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vladimir
    wrote on last edited by
    #1

    Hello! I have been using Cloudron for over a month now and I am very happy with it. Recently I have installed the WP Rocket caching plugin and I have to make a cron task that clears the cache and triggers the preload. WP Rockets suggests to make a php file (my-file-name.php) in the Wordpress directory with this content:

    <?php 
    // Load WordPress.
    require( 'wp-load.php' );
    
    // Clear cache.
    if ( function_exists( 'rocket_clean_domain' ) ) {
    	rocket_clean_domain();
    }
    
    // Preload cache.
    if ( function_exists( 'run_rocket_sitemap_preload' ) ) {
    	run_rocket_sitemap_preload();
    }
    

    And make this cron job:

    wget -q -O - http://yourdomain.com/my-file-name.php?doing_wp_cron >/dev/null 2>&1
    

    I read that Cloudron should have /app/data/crontab cron file but I could't find it. I am trying to run this cron task every day at 12:15 and 16:15.

    Can you help me with this issue?

    1 Reply Last reply
    1
    • imc67I Offline
      imc67I Offline
      imc67
      translator
      wrote on last edited by
      #2

      I have exactly the same situation and question!

      murgeroM 1 Reply Last reply
      0
      • imc67I imc67

        I have exactly the same situation and question!

        murgeroM Offline
        murgeroM Offline
        murgero
        App Dev
        wrote on last edited by
        #3

        @imc67 If the file doesn't exist - just make it. But that said, I do not believe the unmanaged app has cron, which is a shame

        --
        https://urgero.org
        ~ Professional Nerd. Freelance Programmer. ~

        1 Reply Last reply
        0
        • V Offline
          V Offline
          Vladimir
          wrote on last edited by
          #4

          Just a fast update. I found a workaround with WP CRONTROL plugin, where I can add the PHP and make the cron.

          1 Reply Last reply
          0
          • girishG Offline
            girishG Offline
            girish
            Staff
            wrote on last edited by
            #5

            @Vladimir Indeed. This solution is documented in the Managed WP docs and not in the unmanaged one - https://cloudron.io/documentation/apps/wordpress/#cron-tasks . I will fix it up.

            1 Reply Last reply
            1
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Bookmarks
            • Search