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. LAMP
  3. Cron Job Setup Correction

Cron Job Setup Correction

Scheduled Pinned Locked Moved LAMP
6 Posts 4 Posters 416 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.
  • I Offline
    I Offline
    IniBudi
    wrote on last edited by
    #1

    I am installing Sendy self hosted newsletter on my server. But I don't know is it correct or not my Cron job setup.

    # +------------------------ minute (0 - 59)
    # |    +------------------- hour (0 - 23)
    # |    |    +-------------- day of month (1 - 31)
    # |    |    |    +--------- month (1 - 12)
    # |    |    |    |    +---- day of week (0 - 6) (Sunday=0 or 7)
    # |    |    |    |    |
    # *    *    *    *    * command to be executed
    
    *    *    *    *    * echo "=> Doing job" && php /app/data/public/scheduled.php schedule:run >> /dev/null 2>&1
    
    *    *    *    *    * echo "=> Doing job" && php /app/data/public/autoresponders.php schedule:run >> /dev/null 2>&1
    
    *    *    *    *    * echo "=> Doing job" && php /app/data/public/import-csv.php schedule:run >> /dev/null 2>&1
    
    *    *    *    *    * echo "=> Doing job" && php /app/data/public/update-segments.php schedule:run >> /dev/null 2>&1
    

    Could you check it, please? Thank you.

    1 Reply Last reply
    1
    • M Online
      M Online
      msbt
      App Dev
      wrote on last edited by
      #2

      Maybe you need to use the full path to the php version/executable that you're using, e.g. /usr/bin/php8.1 /app/data/public/scheduled.php schedule:run >> /dev/null 2>&1

      I 1 Reply Last reply
      1
      • nebulonN Offline
        nebulonN Offline
        nebulon
        Staff
        wrote on last edited by
        #3

        You should see the "=> Doing job" which you echo in your script in the app logs at the expected times if things are correct.

        1 Reply Last reply
        1
        • M msbt

          Maybe you need to use the full path to the php version/executable that you're using, e.g. /usr/bin/php8.1 /app/data/public/scheduled.php schedule:run >> /dev/null 2>&1

          I Offline
          I Offline
          IniBudi
          wrote on last edited by
          #4

          @msbt I already added the PHP version on my corn job.

          # +------------------------ minute (0 - 59)
          # |    +------------------- hour (0 - 23)
          # |    |    +-------------- day of month (1 - 31)
          # |    |    |    +--------- month (1 - 12)
          # |    |    |    |    +---- day of week (0 - 6) (Sunday=0 or 7)
          # |    |    |    |    |
          # *    *    *    *    * command to be executed
          
          *    *    *    *    * echo "=> Doing job at $(date)" && /usr/bin/php8.3 /app/data/public/scheduled.php schedule:run >> /dev/null 2>&1
          
          *    *    *    *    * echo "=> Doing job at $(date)" && /usr/bin/php8.3 /app/data/public/autoresponders.php schedule:run >> /dev/null 2>&1
          
          
          *    *    *    *    * echo "=> Doing job at $(date)" && /usr/bin/php8.3 /app/data/public/import-csv.php schedule:run >> /dev/null 2>&1
          
          
          *    *    *    *    * echo "=> Doing job job at $(date)" && sudo -u www-data /usr/bin/php8.3 /app/data/public/update-segments.php schedule:run >> /dev/null 2>&1
          

          However, I don't see the "=> Doing job" on my app log. I just saw the external cronjob @nebulon.

          Jan 29 21:32:04 141.101.95.92 - - [29/Jan/2025:14:32:04 +0000] "GET /update-segments.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible; cron-job.org; http://cron-job.org/abuse/)"
          Jan 29 21:32:04 172.71.126.236 - - [29/Jan/2025:14:32:04 +0000] "GET /autoresponders.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible; cron-job.org; http://cron-job.org/abuse/)"
          Jan 29 21:32:06 172.69.222.223 - - [29/Jan/2025:14:32:06 +0000] "GET /import-csv.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible; cron-job.org; http://cron-job.org/abuse/)"
          

          Is there something that I missed to configure?

          1 Reply Last reply
          0
          • J Offline
            J Offline
            joseph
            Staff
            wrote on last edited by
            #5

            The pattern itself is correct. I can copy/paste a single line into a random app and I can see the output logs. Can you do systemctl restart box ? Maybe the cron scheduler is stuck for some reason.

            I 1 Reply Last reply
            1
            • J joseph

              The pattern itself is correct. I can copy/paste a single line into a random app and I can see the output logs. Can you do systemctl restart box ? Maybe the cron scheduler is stuck for some reason.

              I Offline
              I Offline
              IniBudi
              wrote on last edited by
              #6

              @joseph Thank you, it works now! cc: @nebulon

              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