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 Solved Dolibarr
croncrontab
6 Posts 3 Posters 210 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 on 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 on
    • jamesJ Offline
      jamesJ Offline
      james
      Staff
      wrote on 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 on 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 Online
          J Online
          joseph
          Staff
          wrote on 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
          1
          • jamesJ Offline
            jamesJ Offline
            james
            Staff
            wrote last edited by
            #5

            Hello @sebastienserre
            Is this still an issue?

            1 Reply Last reply
            0
            • J joseph has marked this topic as solved
            • sebastienserreS Offline
              sebastienserreS Offline
              sebastienserre
              wrote last edited by
              #6

              Sorry for my late answers. Yes, yes it fixes it. Thank you

              He/Him - Native language: French

              1 Reply Last reply
              0
              • sebastienserreS sebastienserre referenced this topic

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              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