1. Go to this page and download the library: Download tearoom1/kirby-ftp-backup library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tearoom1 / kirby-ftp-backup example snippets
'tearoom1.kirby-ftp-backup' => [
// Plugin Control
'enabled' => true, // Enable/disable the entire plugin
'ftpEnabled' => true, // Enable/disable FTP uploads (backups still created locally)
// FTP Connection Settings
'ftpProtocol' => 'ftps',
'ftpHost' => 'your-ftp-host.com',
'ftpPort' => 21,
'ftpUsername' => 'your-username',
'ftpPassword' => 'your-password',
'ftpDirectory' => 'backups',
'ftpPassive' => true,
'ftpPrivateKey' => 'path/to/private/key.pem',
'ftpPassphrase' => 'your-passphrase',
'ftpTimeout' => 30,
'ftpMaxRetries' => 3,
'ftpRetryDelay' => 5,
'ftpKeepAlive' => 0,
'cliOutputOnSuccess' => false,
// Backup Settings
'backupDirectory' => 'content/.backups', // Local directory to store backups
'backupRetention' => 10, // Number of backups to keep when using simple retention strategy
'deleteFromFtp' => true, // Whether to delete old backups from FTP
'filePrefix' => 'backup-', // Prefix for backup filenames
'retentionStrategy' => 'simple', // Backup retention strategy: 'simple' or 'tiered'
'tieredRetention' => [
'daily' => 10, // Keep all backups for the first 10 days
'weekly' => 4, // Then keep 1 per week for 4 weeks
'monthly' => 6 // Then keep 1 per month for 6 months
],
// File Filtering (regex patterns without delimiters, case-insensitive)
'
'backupRetention' => 10, // Keep 10 most recent backups
'retentionStrategy' => 'tiered',
'tieredRetention' => [
'daily' => 10, // Keep all backups for the first 10 days
'weekly' => 4, // Then keep 1 per week for 4 weeks
'monthly' => 6 // Then keep 1 per month for 6 months
]