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. Support at command in LAMP app

Support at command in LAMP app

Scheduled Pinned Locked Moved Solved LAMP
lampcron
5 Posts 2 Posters 932 Views 2 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.
  • alex-adestechA Offline
    alex-adestechA Offline
    alex-adestech
    wrote on last edited by girish
    #1

    Is it possible to enable the at command using a LAMP app?

    I installed it using apt-get in a custom LAMP app, but I cannot enable it or use it. My goal is to schedule a task (run a script) at the indicated time (timestamps are downloaded from a server and may vary from day to day).

    Screen Shot 2020-08-13 at 19.39.47.png

    1 Reply Last reply
    0
    • girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #2

      @alex-adestech Looks like the at command will require a daemon atd to run. Would it be possible to workaround using cron instead? The lamp app has built-in cron support using which you can schedule at any specific time - https://cloudron.io/documentation/apps/lamp/#cron-support

      1 Reply Last reply
      0
      • alex-adestechA Offline
        alex-adestechA Offline
        alex-adestech
        wrote on last edited by
        #3

        @girish Well, the thing is that I download a JSON Object with some timestamps indicating the next time the server needs to run a specific script. These timestamps are different each day.

        For example, Monday the 1st should run at 3pm and 5 pm, but next Monday should run at 1pm and 9 pm.

        Could it be possible to edit the crontab file using a script?
        The lamp app needs to restart after cron has changed right?

        Maybe that could be a workaround.

        1 Reply Last reply
        0
        • girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #4

          @alex-adestech Ah, I see. The usual workaround for this is to put a command in crontab like so:

          0 * * * * php /app/data/periodic.php
          

          The above runs every hour. Then in periodic.php, you can check the current time or some file to see what tasks you want to run etc.

          Would that work?

          1 Reply Last reply
          1
          • alex-adestechA Offline
            alex-adestechA Offline
            alex-adestech
            wrote on last edited by
            #5

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

            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