\BackupTask
A task that can back up the database and assets and send them to target server.
Synopsis
class BackupTask
extends BuildTask
{
- // members
- protected string $title = 'Perform a backup task';
- protected string $description = 'Creates a database dumpfile and an assets tarfile, and copies them to a specified location.';
- protected static string $rm_path = '/bin/rm';
- protected static string $mysqldump_path = '/usr/local/mysql/bin/mysqldump';
- protected static string $gzip_path = '/usr/bin/gzip';
- protected static string $tar_path = '/usr/bin/tar';
- protected static string $scp_path = '/usr/bin/scp';
- protected static string $ssh_user = 'root';
- protected static string $ssh_host = 'dev.stw.io';
- protected static string $ssh_path = '/bigdata/backup';
- protected static $backup_db;
- protected static $backup_assets;
- protected static $transfer_backup;
- protected static $ip_array;
- // methods
- public void run()
- public void process()
- public void get_client_ip()
- public void verify_ip()
- public static void set_ip_array()
- public static void set_ssh_settings()
Hierarchy
Extends
- BuildTask
Members
protected
- $backup_assets
- $backup_db
- $description
- $gzip_path
- $ip_array
- $mysqldump_path
- $rm_path
- $scp_path
- $ssh_host
- $ssh_path
- $ssh_user
- $tar_path
- $title
- $transfer_backup
Methods
public
- get_client_ip() — Determins the client's IP Address
- process()
- run()
- set_ip_array() — Sets the ip_array in the config
- set_ssh_settings() — Sets the SSH settings for SCP in the config
- verify_ip() — Verifies the clients IP address, returns a permission failure if verification fails