Skip to content

Making backup all files and dirs in folder. Backup the database. Merging all backups and sending to email address

Notifications You must be signed in to change notification settings

globalmp/backupservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

backupservice

Making backup all files and dirs in folder. Backup the database. Merging all backups and sending to email address

Data Base setting

define(DBHOST, 'localhost'); - Host name or IP-adress database (mysql) server

define(DBUSER, 'root'); - database user name

define(DBPASSWD, ''); - database password

define(DBNAME, ''); - database name

SMTP (Email) sending setting

define(SEND_EMAIL, 'info@example.com'); - Email from sending

define(SMTP_SERVER, 'smtp.example.com'); - Server to the sending

define(SMTP_PORT, '465'); - Port of server

define(SMTP_USER, 'info@example.com'); - User for auth on smtp server

define(SMTP_PASSWD, ''); - Password of user to auth on smtp server

define(SMTP_SECURE, 'ssl'); - Type of secure. tls or ssl

Date time formats

define(DATETIMEFORMAT, 'd/m/Y H:i:s'); - data time format to inner data

define(DATETIMEFORMATFORFILE, 'd-m-y-h-i-s'); - date time format to outer (in file name). optional

Methods

filename( data ) string Backup archive file name. Add before time data. If the last used.
db() void If you create and database backup. Necessary use this method before zip() optional
addTime() void Add time data to file name. Use DATETIMEFORMATFORFILE optional
sendTo( data ) string or array Email adresses to the send backup. optional
findTo( data ) string Folder to extract files and dirs for backup. Search data making only this folder. optional
saveTo( data ) string Folder to the save backup ziparchive. Permission (chmod) 0777 optional
zip() void Basic method. This method merge db backup and files backup and (if selected) sending to emails.
deleteBackup() void Delete the backup archive. ATTENTION! use this method only after call method zip()

Example

(new backup)->filename( "SlavaNadejdin" )->db()->addTime()->sendTo( "info@example.com" )->findTo( "" )->saveTo( "tmp" )->zip()->deleteBackup();

Future

1. Adding features of password to zip archive

2. Multi-sites creating backup and merge in one.

About

Making backup all files and dirs in folder. Backup the database. Merging all backups and sending to email address

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages