Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Schedule backup #12

@Ladylain

Description

@Ladylain

Hi,

First, really thanks for this plugin.

Second, i don't know where to post this, so i put it here and i hope that you will tell me what to do exactly if there is something to do. :)

I was needed to have this plugin creating backup automatically and twice a day. So i have register a schedule into the plugin.php file. But i think for the next version we can improve this feature to make this as a setting with more parameters like :

  • when the user wants to create backup,
  • what backup the user need to create automatically.

So, if someone need to automate this plugin, just add this code into plugin.php and be sure to have configure your cron jobs for octobercms like it is said into octobercms docs.

PanaKour\Backup\plugin.php

public function registerSchedule($schedule) {
        $schedule->call(function () {
            $records = Backups::createBackup(['--disable-notifications' => true]);
        })->twiceDaily(1, 12);
    }

and change the function createBackup() to be static

PanaKour\Backup\Controllers\Backups.php:36

public static function createBackup($artisanArguments)

Hope it can help someone :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions