Backup Scheduling
The system provides a cron job that can be used to schedule the backup generation at specific intervals, such as daily, weekly or monthly.
You can set up such cron job by following these steps:
- visit the Configuration > CRON Jobs page from the back-end of VikAppointments;
- click the See Cron Jobs List button;
- click the New button from the toolbar;
- enter a descriptive name;
- pick the "Backup Creator" option under the Class parameter;
- publish the cron job;
- select the execution interval from the apposite dropdown (it is not suggested to use an interval lower than "every day");
- hit the Save button.
At this point, you can go back to the Configuration > CRON Jobs page and access the Installation tab. You should follow the instructions listed there in order to set up a task that will be periodically executed by the server.
Under the configuration of the cron job, you should be able to see also a parameter named Maximum Archives, which lets you choose the maximum number of backup archives that can be created. When the specified threshold is reached, the system will automatically delete the oldest backup(s) to allow the creation of a new one. This is very useful to automatically free some disk space.
The archives created through a backup always specify the "cron_" prefix at the beginning of the name. This way the system will delete only the backups created through a cron and will always ignore the backups that have been manually created.
Just to make an example, lets assume that we have the following backups currently stored on our system:
- cron_backup_full_2022-01-29 22:00:00.zip
- cron_backup_full_2022-01-22 22:00:00.zip
- cron_backup_full_2022-01-15 22:00:00.zip
- cron_backup_full_2022-01-08 22:00:00.zip
- backup_full_2022-01-05 15:32:27.zip
- cron_backup_full_2022-01-01 22:00:00.zip
and the Maximum Archives parameters has been configured to keep at most 5 backups. When the system will generate the backup on the 5th of February (once every week), only the oldest one will be deleted (cron_backup_full_2022-01-01 22:00:00.zip). The other one (backup_full_2022-01-05 15:32:27.zip) won't be touched because it has not been created by a cron job.