Cron not behaving correctly (some crons run, but not purging backups and custom crons stuck in 'ready')

I’ve setup cron for my Grav site and cache-clearand default-site-backup are running. However, it does not cleanup old backups. Max retention time is set to 7 days.

  trigger: time
  max_backups_count: 25
  max_backups_space: 5
  max_backups_time: 7
    name: 'Default Site Backup'
    root: /
    exclude_paths: "/backup\n/cache\n/images\n/logs\n/tmp"
    exclude_files: ".DS_Store\n.git\n.svn\n.hg\n.idea\n.vscode\nnode_modules"
    schedule: true
    schedule_at: '0 3 * * *'

The following crons are enabled in /var/www/

  logrotate-grav: enabled
  delete-email-data: enabled
  cache-purge: enabled
  cache-clear: enabled
  default-site-backup: enabled
    command: /usr/sbin/logrotate
    args: '--verbose --state=/var/www/ /var/www/'
    at: '0 1 * * *'
    output: logs/logrotate-grav.log
    output_mode: overwrite
    email: null
    command: /usr/bin/find
    args: '/var/www/ -mtime +90 -delete -print'
    at: '5 4 * * *'
    output: logs/delete-email-data.log
    output_mode: overwrite
    email: null

However, I also have configs in /var/www/ In there it contains a different config. For example, the 7 day purge is not enabled there. Should I remove that subfolder because it overrides the configs set in the Grav admin panel? For some reason the admin panel does not change those values. I did not create this directory (on purpose).

@AquaL1te, Grav’s Environment Configuration might be at work here…

Once folders like /user/env/ or /user/ exists, Grav will read the configs from that folder when the site is accessed using the url Any config change made in Admin will also be written into those folders.

If you delete the folders, Grav will fallback to /user/config/.

1 Like