Feature/manual backup script
Idea
Add a special script that makes a manual backup of required website.
The problem
Currently ISPConfig can make only automatic cron based backups and there's no way to manually trigger a backup process for desired website. There's a workaround to use a cron_debug.php
:
php /usr/local/ispconfig/server/cron_debug.php --cronjob=500-backup.inc.php
However such approach will create backups for all websites and will not make backups for websites that are inactive or have backup option disabled.
Features
The script in this PR has the following features:
- make backup only of a single website specified by user
- the backup works even for websites that are inactive or have a backup feature disabled
- the backup script respects the maximum backup count option and removes previous old backups if required:
- the backups produced by the script become visible in the ISPConfig interface: All the "Restore", "Download" and "Delete" buttons are functional.
Related issues
The problem of making backups was discussed here #3947 (closed). Current PR does not completely solve this issue, but is a first step for that. The next step would be to add a button to the ISPConfig interface to trigger the backup process from there.
Usage
Currently the manual backup can be started from the command line:
Usage:
php backup-now.php --id=<4>
Options:
--id id of the website to backup.
The id
is obtained from the ISPConfig interface:
Compatibility
Tested with ISPConfig stable, Debian 9.9 (stretch) and PHP 7.3.8. Should be compatible with all environments supported by ISPConfig.