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. Grav CMS
  3. Cron for Backups

Cron for Backups

Scheduled Pinned Locked Moved Solved Grav CMS
5 Posts 3 Posters 1.3k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hey Folks,
    Grav needs a Cronjob to do scheduled backups. I tried by using several "how-tos" already in the docs of other apps, in this forum, and from the original Grav-Documentation, but i can't manage to get it working.
    Maybe you know a way of getting it to work?

    What i did so far:
    Created a manual crontab file in app/data/ + restart
    Then run the bin/grav scheduler -i command which outputs, everything would be fine.
    But after another restart, Grav still has no Cronjob available and outputs this:
    Bildschirmfoto 2021-01-23 um 10.46.35.png

    Appreciate every help 🙂

    girishG 1 Reply Last reply
    0
    • jimcavoliJ Offline
      jimcavoliJ Offline
      jimcavoli
      App Dev
      wrote on last edited by
      #2

      This would typically be done via the scheduler add-on in the app packaging. It wasn't implemented initially since Cloudron does its own automatic backups of the site. Is there an additional advantage to having these backups as opposed to just using the built-in Cloudron ones? I believe you can still manually create one if needed for portability between installations

      1 Reply Last reply
      0
      • ? A Former User

        Hey Folks,
        Grav needs a Cronjob to do scheduled backups. I tried by using several "how-tos" already in the docs of other apps, in this forum, and from the original Grav-Documentation, but i can't manage to get it working.
        Maybe you know a way of getting it to work?

        What i did so far:
        Created a manual crontab file in app/data/ + restart
        Then run the bin/grav scheduler -i command which outputs, everything would be fine.
        But after another restart, Grav still has no Cronjob available and outputs this:
        Bildschirmfoto 2021-01-23 um 10.46.35.png

        Appreciate every help 🙂

        girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #3

        @timbo The scheduler is already configured, so the backups should probably already be autogenerated if you enable the default-site-backup. The scheduler is run every 5 minutes by the package. Grav doesn't realize it's configured properly because I guess it's looking into crontab or something but Cloudron packages do not use cron.

            "scheduler": {
              "grav_scheduler": {
                "schedule": "*/5 * * * *",
                "command": "sudo -u www-data -E -- /app/code/bin/grav scheduler"
              }
        
        1 Reply Last reply
        0
        • girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #4

          I added a custom scheduler job like this:

          41a1381b-5ae5-47f3-8157-7fc59506f525-image.png

          I can then see the ls cron job is run:

          root@933fe4a5-e1c6-4c14-a14b-c9ff02d6c559:/app/code/logs# tail -f ls-cron.txt 
          lrwxrwxrwx  1 root     root       14 Jan 22 17:32 logs -> /run/grav/logs
          -rw-rw-r--  1 www-data www-data   72 Jan 21 22:19 now.json
          -rw-rw-r--  1 www-data www-data  274 Jan 21 22:19 robots.txt
          drwxrwxr-x 10 www-data www-data 4.0K Jan 21 22:19 system
          drwxrwxr-x  8 www-data www-data 4.0K Jan 21 22:19 tests
          lrwxrwxrwx  1 root     root       13 Jan 22 17:32 tmp -> /run/grav/tmp
          lrwxrwxrwx  1 root     root       14 Jan 22 17:32 user -> /app/data/user
          drwxrwxr-x  8 www-data www-data 4.0K Jan 21 22:19 user.original
          drwxr-xr-x 31 www-data www-data 4.0K Jan 22 17:32 vendor
          drwxrwxr-x  2 www-data www-data 4.0K Jan 21 22:19 webserver-configs
          
          
          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Oh yes, i just realized that it actually is already setup. Sorry - works fine 🙂

            1 Reply Last reply
            1
            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