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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved How to increase cron interval in WP-unmanaged app?

    WordPress (Managed)
    wordpress
    4
    15
    329
    Loading More Posts
    • 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.
    • imc67
      imc67 translator last edited by girish

      Hi all,

      The standard cron interval in the (unmanaged)-Wordpress app is 5 minutes, I would like to increase this to 1 minute (I use the unmanaged WP app).

      How do I do that as it is not a config item in Cloudron?

      Kind regards,

      Marcel.

      murgero 1 Reply Last reply Reply Quote 0
      • murgero
        murgero App Dev @imc67 last edited by

        @imc67 The cron file might be in /app/data/crontab or similar name, can you see a file like that?

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

        1 Reply Last reply Reply Quote 0
        • imc67
          imc67 translator last edited by

          Hi @murgero, thanks for your quick response!

          In that folder there are only: credentials.txt php.ini /public 😞

          Kind regards,

          Marcel.

          murgero 1 Reply Last reply Reply Quote 0
          • murgero
            murgero App Dev @imc67 last edited by

            @imc67 You can make the file (assuming wp-unmanged is based on the LAMP app) called crontab and put what you need in there. Would be worth a test.

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

            1 Reply Last reply Reply Quote 0
            • nebulon
              nebulon Staff last edited by

              Currently there is no way to customize the cron schedule, it is fixed in the app package manifest to every 5 minutes. What is the use-case for making this more frequent? We can change this if there are good reasons.

              imc67 1 Reply Last reply Reply Quote 0
              • imc67
                imc67 translator @nebulon last edited by

                @nebulon Hi Johannes, thanks for your response. In Wordpress itself there are 1 minute cron interval types and plugins are using it. Now some plugins give cron-errors like "there are 5 unfinished cron tasks, is there something wrong with your cron?".

                Kind regards,

                Marcel.

                1 Reply Last reply Reply Quote 0
                • girish
                  girish Staff last edited by

                  @imc67 We will push an update so that the cron interval is configurable.

                  1 Reply Last reply Reply Quote 1
                  • imc67
                    imc67 translator last edited by imc67

                    @girish this would be awesome!!!

                    1 Reply Last reply Reply Quote 0
                    • imc67
                      imc67 translator last edited by

                      @girish Today there was an app update to 1.2.2 with description: Make cron granularity 1 second

                      I was very curious what was changed and I discovered the cron interval is now every 2 minutes. In the app manifest (yes I've found that 😉 ) the cron is now:

                      "schedule": "*/1 * * * *"

                      This means every other minute (so every 120 seconds). Now I'm very curious what the update description means?

                      With these 2 minutes I'm already happy, it would be a little bit better to have it every minute: "schedule": "* * * * *"

                      Kind regards and keep up the good work! I'm already have some production sites in Cloudron and unmanagedWP-app and I'm very very happy with this great product!!

                      Kind regards,

                      Marcel

                      1 Reply Last reply Reply Quote 0
                      • girish
                        girish Staff last edited by

                        @imc67 The pattern means every minute. Why do you think it means every 2 minutes? https://cronexpressiondescriptor.azurewebsites.net/?expression=%2F1++++*&locale=en

                        Also, for code changes, you can always track https://git.cloudron.io/cloudron/wordpress-unmanaged-app

                        1 Reply Last reply Reply Quote 0
                        • imc67
                          imc67 translator last edited by

                          @girish Hi, thanks for your response, the result of the "*/1 * * * *" is:

                          [2019-05-31 09:10:31] - [Cron Request]- 120.29s after the previous one. | Cron called from 127.0.0.1 (?)
                          [2019-05-31 09:08:31] - [Cron Request]- 119.87s after the previous one. | Cron called from 127.0.0.1 (?)
                          [2019-05-31 09:06:31] - [Cron Request]- 120.13s after the previous one. | Cron called from 127.0.0.1 (?)
                          [2019-05-31 09:04:31] - [Cron Request]- 119.92s after the previous one. | Cron called from 127.0.0.1 (?)
                          [2019-05-31 09:02:31] - [Cron Request]- 119.97s after the previous one. | Cron called from 127.0.0.1 (?)
                          

                          So all almost exactly 120 seconds interval.

                          As far as I know a 1 minute interval is "* * * * *" (https://crontab.guru/every-minute)

                          So it would be really great if this could be implemented 🙂

                          Kind regards,

                          Marcel.

                          1 Reply Last reply Reply Quote 0
                          • nebulon
                            nebulon Staff last edited by

                            Apparently both patterns are equivalent, not sure why you see those exactly two minutes apart. I did a quick test locally with the same cron module and I get for both every minute. Will do a cloudron app test later.

                            1 Reply Last reply Reply Quote 0
                            • nebulon
                              nebulon Staff last edited by

                              I just tested the WordPress unmanaged app regarding the currently published cron pattern and I cannot reproduce the 2 minutes interval:

                              10:44:09 - => Run cron job
                              10:44:10 - Success: Executed a total of 0 cron events.
                              10:45:09 - => Run cron job
                              10:45:10 - Success: Executed a total of 0 cron events.
                              10:46:09 - => Run cron job
                              10:46:10 - Success: Executed a total of 0 cron events.
                              

                              Not sure what the difference between our two deployments are now.

                              1 Reply Last reply Reply Quote 0
                              • imc67
                                imc67 translator last edited by

                                @nebulon OMG I have to apologize!

                                This log is from a plugin and that has an own 2 minute schedule 😞
                                I checked the app log and there is indeed a 1 minute cron call.

                                I'm deeply ashamed for this mistake, sorry!

                                Kind regards,

                                Marcel.

                                1 Reply Last reply Reply Quote 0
                                • nebulon
                                  nebulon Staff last edited by

                                  No worries, at least now we know what happened.

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post
                                  Powered by NodeBB