Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup is enabled by default on new install, when the docs says it should not be #3818

Closed
eauchat opened this issue Apr 17, 2024 · 4 comments

Comments

@eauchat
Copy link

eauchat commented Apr 17, 2024

As detailed in this issue and this older forum post, grav seems to have backup enabled by default, even when having no user/config/backup.yaml and user/config/scheduler.yaml files.

As of the system config system/config/backup.yaml, it seems it shouldn't be the case:

purge:
    trigger: space
    max_backups_count: 25
    max_backups_space: 5
    max_backups_time: 365

profiles:
  -
    name: 'Default Site Backup'
    root: '/'
    schedule: false
    schedule_at: '0 3 * * *'
    exclude_paths: "/backup\r\n/cache\r\n/images\r\n/logs\r\n/tmp"
    exclude_files: ".DS_Store\r\n.git\r\n.svn\r\n.hg\r\n.idea\r\n.vscode\r\nnode_modules"

Also, in my fresh install, I have no system/config/scheduler.yaml file. Wondering if that's normal.

What's setup in system/config/backup.yaml and the doc on backups seem to be explicitly saying there shouldn't be any backup unless I voluntarily set it up. But on every fresh install I make, I'm having automatic backups ran every night.

Is there something I misunderstood?

In case that's relevant, I'm installing grav with yunohost, which uses the following install script.

@rhukster
Copy link
Member

The backups.yaml config is only used if you click 'backup' manually.. So while the configuration is there, backups are not going to happen unless you initiate. This is a system provided file.

The scheduler.yaml is not a system provided file, and will be created in the user/config/scheduler.yaml configuation after you have setup the scheduler (requires a crontab entry), and saved the configuration. No backups will occur automatically until you have:

  1. installed the crontab entry on your system
  2. configured and saved the scheduler configuration.

This is the normal and expected behavior. Cheers.

@eauchat
Copy link
Author

eauchat commented Apr 24, 2024

Yes indeed what you're describing is exactly the behaviour I'd expect.
The thing is that it's not how it was occurring on my install.

The scheduler crontab was setup during install with the following command

echo "* *  *  *  * $app php$phpversion $install_dir/bin/grav scheduler 1>> /dev/null 2>&1" > /etc/cron.d/$app

But I had no user/config/scheduler.yaml file.

And backup where happening every day.

What I can't explain is why the backup were happening while having no user/config/scheduler.yaml file.
Or else there's something I misunderstood either in your explanation or somewhere else.

Anyway, I resolved the issue (and so did the maintainer of the yunohost package) by creating a user/config/scheduler.yaml file with the configuration I want to have. Just wanted to report since I felt there was something strange going on. But maybe it's not due to grav itself but to other quirks somewhere else that I don't know about.

@rhukster
Copy link
Member

Then i think this is an issue with your installer package. Grav doesn't install that command by default, and it's something you are 'instructed' to do when you want to enable scheduler. It sounds like your install script: https://github.com/YunoHost-Apps/grav_ynh/blob/master/scripts/install should create a default scheduler yaml or not include the crontab entry.

Not a grav problem, purely your 3rd party and not-supported install script.

@eauchat
Copy link
Author

eauchat commented Apr 24, 2024

Ok got it. Then sorry for the noise.

So if the proper way when installing is to:

  • add the cron line AND set a proper scheduler.yaml file,
  • or do neither.

Indeed there was an issue in the yunohost installer. (Which has now been fixed :))

Thanks for your help and availability and sorry again for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants