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


Skip to content
  • Create cron in LAMP

    Solved LAMP
    5
    0 Votes
    5 Posts
    54 Views
    matix131997M

    Thanks, it works!

  • Run cron once on after app update

    Solved Support
    5
    1 Votes
    5 Posts
    64 Views
    LanhildL

    Thanks, that solves it!

  • Cronjob of Surfer App stopped?

    Solved Support
    10
    1 Votes
    10 Posts
    145 Views
    girishG

    So, "Send Healthcheck" and "OK" are printed before and after your cron ? If that's the case, looks like it didn't complete. If you do docker inspect , you will find a container there like crontab.0 or something which is your container. You can exec into it and ps and check if that curl is stuck.

  • How to add a cronjob in cloudron

    Solved Support
    6
    1 Votes
    6 Posts
    194 Views
    S

    Got it thanks.

  • 0 Votes
    5 Posts
    327 Views
    fbartelsF

    Hi @girish, ah that fully explains why I cannot interact with the processes running in the container. While your design idea is probably suitable for most cases it won't really work for this specific one.

    But no harm done, then I will just add a cron service to my app container directly.

  • CRON Help

    Firefly III
    5
    0 Votes
    5 Posts
    375 Views
    girishG

    I have added a note in the docs and in the UI as well.

  • Verify Cron is Running

    Solved LAMP
    9
    0 Votes
    9 Posts
    588 Views
    J

    @girish said in Verify Cron is Running:

    1 * * * * (echo "Trigger is running now"; /usr/bin/php -d memory_limit=-1 -d max_execution_time=0 /app/data/public/path/to/task/trigger.php) > /proc/$(cat /var/run/crond.pid)/fd/1 2>&1

    Perfect, thank you so much! That worked out very well!

  • 0 Votes
    8 Posts
    404 Views
    d19dotcaD

    Thanks guys! Yeah it's a weird issue for sure and likely very rare, so it's probably not a big deal. If it helps for reproducing it, here's a few notes:

    27 apps installed at the time of backup/restore Backup & Restore used tgz format with OVH Object Storage in BHS region Backup from a LunaNode m.8 model in Toronto region Restored onto OVH b2-7 model (though since upgraded to b2-15) in BHS3 region LunaNode instance (source) was running Ubuntu 18.04 at backup time, and OVH instance (target) was running Ubuntu 20.04 at the time of restore. When I restored, I very nearly ran out of disk space on the included disk, leaving only ~ 1.5 GB of space remaining. When restoring initially, it failed to restore because of the issue I reported earlier, though doubtful this is a root cause. Immediately moved the boxdata to external disk afterwards though, so plenty of space free soon after the restore was done once I moved boxdata off (20 GB in emails alone so it takes up a lot of space).

    Hopefully those notes above help in some small way. No worries though if you can't reproduce it, I imagine it's a very rare scenario and could have even been completely unique to me somehow. Hopefully others can chime in though if they experienced anything similar where cron wouldn't run at all (whether a restore involved or not, as I'm still not 100% certain it had to do with the restore though I presume it did).

  • Cron job only every 10 minutes?!

    EspoCRM
    9
    3 Votes
    9 Posts
    497 Views
    girishG

    @imc67 Pushed a new package now

  • 0 Votes
    4 Posts
    320 Views
    girishG

    @saikarthik GMT/UTC

  • 0 Votes
    18 Posts
    626 Views
    LonkleL

    @imc67 said in Wordpress (unmanaged) CRON interrupts product loading:

    If you set it to 5 then WP site check is complaining that there are missed events. Because either WP or plugins can create 1 minute tasks.

    Yes, cron scheduled Wordpress can be scheduled down to the minute. But they're expected to be missed. The default WP-Cron interval is "whenever the next person visits the site, run all the scheduled events that are in the past and haven't been run" (the one that Cloudron rightfully uses the WP-CLI and disables the native WP-Cron). That's pretty horrible, but that's what Wordpress installs expect the environment to be at default. So, the WP Site Check says that's notable, that wp-crons don't get run at the minute they're specified?

    If the WP Health Status Page actually says that, then Wordpress devs clearly think 1 minute (or a hugely popular site) is the best interval.

  • 0 Votes
    7 Posts
    426 Views
    girishG

    @tamayers I pushed a new package. You can customize the cron via /app/data/crontab. Just restart the app after editing the cron timing.

  • Support at command in LAMP app

    Moved Solved LAMP
    5
    0 Votes
    5 Posts
    245 Views
    alex-adestechA

    @girish you're a genius man! I think it should work, I'll try it and come back. Thanks!!

  • 1 Votes
    5 Posts
    410 Views
    girishG

    @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.

  • 0 Votes
    6 Posts
    474 Views
    d19dotcaD

    @girish A fresh install already has it set to "No"? Interesting, I don't recall ever setting mine to "Yes", but I guess I did. Thank you for confirming, seems it's okay then if it's set to "No" by default and the cronjob is doing it automatically.

  • 0 Votes
    2 Posts
    373 Views
    girishG

    @tamayers In the Web Terminal, there is a cron button on the top which will paste the command for running the job. There are 2 cron tasks in invoice ninja - invoices & reminders

    dc6586d2-eadf-43c5-a778-8ed05a4c9001-image.png

  • 0 Votes
    4 Posts
    205 Views
    girishG

    There's a bunch of plugins like WP Crontrol, Advanced cron, Simple cron. You can use them to setup a custom pattern and call a custom function. Your PHP function can just shell exec your script (or maybe you can even write PHP depending on your use case).

  • How to add cronjob to running cloudron app?

    Solved Support
    5
    1 Votes
    5 Posts
    981 Views
    girishG

    As others said, usually the cron job is part of the app itself. If for some reason you want to run some cron task outside the scope of the app, then you can use a script like below and put it in the crontab of your server.

    #!/bin/bash # this is the app's domain name app="test.smartserver.space" # detect the container id of the app container_id=$(docker ps -q -f label=fqdn=$app -f label=isSubcontainer=false) echo "App container id is : $container_id" # we can now run arbitrary commands in the container. below we run a command as the www-data user. docker exec $container_id sudo -u www-data ls -l