- You can select the MySQL tables which to backup.
- You can backup the whole website, or the folders and files you wish.
- Ability to exclude files from backup (by their extension).
- Automatic backups of folders and MySQL database (by a small PHP script which must be accessed from Cron Jobs).
- Supports both PDO and MySQLi for accessing MySQL databases in PHP.
- Ability to restore the backup of the MySQL tables.
- You can Download, and Delete the ZIP archives with backups from server.
- The script can be easily translated and used in other languages, without affecting the code. - PHP 5.4+
- Modern Browser with JavaScript enabled (Mozilla-Firefox, Google-Chrome, Opera, Internet-Explorer 9+).
- Open the config.php file (in the "spbm/php/" folder) and add your Name and Password for Admin (to the $admin_name and $admin_pass variables).
- If you want to change the Root directory of the folders and files which can be selected for backup, change the value of the "ROOT_DIR" constant with the path of the directory you want for Root (RELATIVE TO THE ROOT OF YOUR WEBSITE ON SERVER, starting with "/").
- Copy the "spbm" folder on your server (with all its content).
- Set CHMOD 0755 (or 0777) permissions to the "spbm/backup/" folder on your server (it is used to store the ZIP files with the backups).
- Access the "spbm/index.php" file in your browser, with the address from server; for example: http://localhost/spbm/index.php
- Add your Admin name and password to loggin.
- To backup the MySQL tables, click on the "Connect to a Database" tab, and add your data for connecting to MySQL database (MySQL server, Username, Password, Database_Name). Then select the tables you want to backup.
- To backup the website folders and files, click on the "Backup Directories /Files" tab, and select the folders and files you want to backup (use the buttons from the top-right side).
- To Restore, Download or Delete archive with backup, click on the "Show saved ZIP files" tab.
For example, you can use one of these commands in Cron Jobs:
curl http://WEBSITE_NAME/spbm/pbm_cron.php?cron=ADMIN_NAME > /dev/nullOR:
lynx -source http://WEBSITE_NAME/spbm/pbm_cron.php?cron=ADMIN_NAME > /dev/nullOR:
/usr/local/bin/php /home/CPanelUSER/public_html/spmb/pbm_cron.php ADMIN_NAME > /dev/null• Edit these settings in "config.php":
- In the $bk_cron_mysql array add your data for connecting to database.
- In the $bk_cron_dirs array you can add the folders you want to backup, located in the ROOT_DIR (To backup all the folders and files of ROOT_DIR, let the value as it is: ['']).
Example:
$bk_cron_dirs = ['dir1', 'dir2', 'dir3'];- In the $bk_exc array you can add the extensions of the files you want to exclude from backup.
Example:
$bk_exc = ['ext1', 'ext2', 'ext3'];- If you Not want to backup mysql database, set 0 to the BK_CRON_SQL constant.
- If you Not want to backup directories, set 0 to the BK_CRON_DIR constant. • By default, the ZIP archive with the database backup is saved with this format: "mysql-DB_NAME-DATE@TIME.sql.zip", so, every backup of the same database is saved into a new Zip file. If you want to have a fixed name for the database backup, change the "new" value of the ZIP_SQL constant with "fix"; so, the ZIP file with the database backup will have this format: "mysql-DB_NAME.sql.zip" (In Cron the script uses "fix").
• The name of the ZIP archive with directories and files is saved with this format: "dir-ROOT_DIR.zip".
• If you want to save the ZIP files in other directory on your server, modify the value of the BK_DIR constant in the "config.php" file.
• If you want to use the script in other language, translate the texts from the lang_en.json file (in the "spbm/templ/" foder) and save it in other "lang_...json" file, with the indice of the language, for example for Chinese save the texts in the "lang_ch.json". The texts in the ".json" file must be stored in valid JSON format. Then, change the value of the LANG constant in the "config.php" file with the same indice.
define('LANG', 'ch');
• Home Page: http://coursesweb.net/php-mysql/simple-backup-manager
- This script is Free, and Open Source. You can use, modify and publish it freely.
With blessing, MarPlo - MarPlo.net / CoursesWeb.net