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
  • Brite
  • 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 - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. Dolibarr
  3. WHich user for Cron task ?

WHich user for Cron task ?

Scheduled Pinned Locked Moved Unsolved Dolibarr
croncrontab
4 Posts 3 Posters 38 Views 3 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.
  • sebastienserreS Offline
    sebastienserreS Offline
    sebastienserre
    wrote last edited by
    #1

    Hello,
    I've set a cron task from the app (Dolibarr) panel:
    text alternatif

    I assume this task is run as root? (or not www-data user)
    Am I right ?

    If I need to change the user, do you suggest to edit the crontab from the web terminal ?
    crontab -e ?

    Thanks

    He/Him - Native language: French

    1 Reply Last reply
    0
    • jamesJ james moved this topic from Support
    • jamesJ Offline
      jamesJ Offline
      james
      Staff
      wrote last edited by
      #2

      Hello @sebastienserre
      By default, the @dolibarr app executes:

      */15 * * * * /usr/bin/php /app/pkg/cron_run_jobs_custom.php
      

      Is your cron job something that really needs to be configured like this?

      1 Reply Last reply
      0
      • sebastienserreS Offline
        sebastienserreS Offline
        sebastienserre
        wrote last edited by
        #3

        Hello @james
        I have an recurrent invoice created each 28th of the month and yesterday, it has not been created (first 28th after migrating to Cloudron).
        So I thought the Cron task was not run.
        i've added it on the Cron tab from the panel but the pdf generated by Dolibarr was owned by root user.

        He/Him - Native language: French

        1 Reply Last reply
        1
        • J Offline
          J Offline
          joseph
          Staff
          wrote last edited by
          #4

          @sebastienserre yes, cron commands are run as root. To run as a specific user, use sudo or gosu .

          gosu www-data:www-data /usr/bin/php /app/code/protected/yii cron/run
          

          OR

          sudo -E -u www-data php /app/code/upload/api/cron.php
          
          1 Reply Last reply
          0
          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