Skip to content

Instantly share code, notes, and snippets.

@pacmandv
pacmandv / magento_database_backup.php
Created June 8, 2017 06:39 — forked from hslatman/magento_database_backup.php
Create a Magento database backup
<?php
/******************************************************************************************************************
* Source: http://www.emvee-solutions.com/blog/magento-create-database-backup-php-code/
*
* Creating a Magento database backup in var/backups
******************************************************************************************************************/
//increase execution time
ini_set('max_execution_time', 900); //900 seconds = 15 minutes
@pacmandv
pacmandv / magento_custom_index.php
Created June 8, 2017 06:39 — forked from hslatman/magento_custom_index.php
Custom Magento re-indexing script
<?php
/******************************************************************************************************************
* Source: http://www.emvee-solutions.com/blog/magento-custom-reindex-script/
*
* Custom Magento re-indexing script
******************************************************************************************************************/
//Place this file in your Magento root folder, or modify the require once to match your directory.
@pacmandv
pacmandv / archive.php
Created June 7, 2017 14:48 — forked from hslatman/archive.php
Create .tar archive of all files in directory
<?php
/******************************************************************************************************************
* Source: http://www.emvee-solutions.com/blog/create-tar-files-archive-files-server-using-php-script/
*
* Please note that the script wil by default tar all files and (sub)folders from the directory you uploaded the script to
* into a file named archive.tar. You can overwrite the directory and archive name by calling the script with your own
* parameters, like this (replace the italic text for your own needs):
*
* http://domain.com/archive.php?targetname=achivename.tar&dir=relative/folder/to/put/in/archive/
******************************************************************************************************************/
@pacmandv
pacmandv / backup.php
Created June 7, 2017 14:48 — forked from toddsby/backup.php
backup.php
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* (c) 2012-2014: Marvin Menzerath - http://menzerath.eu
* contribution: Drew Toddsby
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
ini_set('memory_limit','1024M');
@pacmandv
pacmandv / cleanup.sh
Created June 7, 2017 14:48 — forked from alfredfox/cleanup.sh
PHP script to backup DB, zip web directory and backup .htaccess file. 4 complete backups
#! /bin/bash
# Enter directory
cd "backups/"
# Count Files in dir
FILES=$(ls | wc -l)
# If FILES are more than 12 remove sort by oldest
while [ $FILES -gt 12 ]; do
@pacmandv
pacmandv / backup.php
Created June 7, 2017 14:47 — forked from menzerath/backup.php
PHP: Recursively Backup Files & Folders to ZIP-File
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* MIT-License - Copyright (c) 2012-2017 Marvin Menzerath
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
ini_set('memory_limit','1024M');