Scheduling Tasks
#Plakar includes a scheduler that can run backups as well as tasks like restoring files, synchronizing Kloset stores, and verifying backup integrity. In this guide, we will show how to set up the scheduler to run backups every day.
Requirements
#Create a configuration for your Kloset store. This ensures the scheduler can later retrieve the store passphrase:
$ plakar store add mybackups /var/backups passphrase=mysuperpassphraseThen, create the store referencing the configuration:
$ plakar at "@mybackups" createConfiguration
#Create the configuration file scheduler.yaml for the scheduler in your current directory with the following content:
agent:
tasks:
- name: backup Plakar source code
repository: "@mybackups"
backup:
path: /Users/niluje/dev/plakar/plakar
interval: 24h
check: trueThis configuration file defines a task for the Plakar scheduler, where:
nameis the task label, displayed in the UI.repositoryrefers to the Kloset store. The syntax@mystorecorresponds to the store previously configured withplakar store add mystore.backupis the task type. In this case, we back up the Plakar source code at the given path every 24 hours.checkruns a verification after the backup is created.
Running the scheduler
#You can start the scheduler by running:
$ plakar scheduler start -tasks ./scheduler.yamlThe scheduler runs in the background. To stop it, run:
$ plakar scheduler stop