Version Notes
Initial Release
Download this release
Release Info
Developer | V Group Inc |
Extension | Vgroup_Backupdel |
Version | 1.9.2.1 |
Comparing to | |
See all releases |
Version 1.9.2.1
- app/code/community/Vgroup/Backupdel/Helper/Data.php +9 -0
- app/code/community/Vgroup/Backupdel/Model/Backupdel.php +16 -0
- app/code/community/Vgroup/Backupdel/Model/Observer.php +35 -0
- app/code/community/Vgroup/Backupdel/Model/System/Config/Source/Backupdel/Values.php +50 -0
- app/code/community/Vgroup/Backupdel/controllers/IndexController.php +38 -0
- app/code/community/Vgroup/Backupdel/etc/adminhtml.xml +29 -0
- app/code/community/Vgroup/Backupdel/etc/config.xml +74 -0
- app/code/community/Vgroup/Backupdel/etc/system.xml +44 -0
- package.xml +18 -0
app/code/community/Vgroup/Backupdel/Helper/Data.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Promos Data helper
|
4 |
+
*
|
5 |
+
* @author Magento
|
6 |
+
*/
|
7 |
+
class Vgroup_Backupdel_Helper_Data extends Mage_Core_Helper_Data
|
8 |
+
{
|
9 |
+
}
|
app/code/community/Vgroup/Backupdel/Model/Backupdel.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Promos item model
|
5 |
+
*
|
6 |
+
* @author Magento
|
7 |
+
*/
|
8 |
+
class Vgroup_Backupdel_Model_Backupdel extends Mage_Core_Model_Abstract {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Define resource model
|
12 |
+
*/
|
13 |
+
protected function _construct() {
|
14 |
+
$this->_init('vgroup_backupdel/backupdel');
|
15 |
+
}
|
16 |
+
}
|
app/code/community/Vgroup/Backupdel/Model/Observer.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Promos item model
|
5 |
+
*
|
6 |
+
* @author Magento
|
7 |
+
*/
|
8 |
+
class Vgroup_Backupdel_Model_Observer {
|
9 |
+
|
10 |
+
public function method() {
|
11 |
+
|
12 |
+
mail('akhilesh.chourey@vgroup.net', 'Cron of Backup delete run in cuda brand', 'method runs');
|
13 |
+
|
14 |
+
$filelist = array();
|
15 |
+
if ($handle = opendir(Mage::getBaseDir('var') . DS . "backups" . DS)) {
|
16 |
+
while ($entry = readdir($handle)) {
|
17 |
+
$filelist[] = array('file' => $entry, 'date' => strtotime(date("d-m-Y", filectime(Mage::getBaseDir('var') . DS . "backups" . DS . $entry))));
|
18 |
+
}
|
19 |
+
closedir($handle);
|
20 |
+
}
|
21 |
+
//backupdel/view/backupdel
|
22 |
+
$day = Mage::getStoreConfig('backupdel/view/backupdel');
|
23 |
+
$time = strtotime(date('d-m-Y', strtotime('-' . $day . ' day')));
|
24 |
+
//echo $time;
|
25 |
+
unset($filelist[0]);
|
26 |
+
unset($filelist[1]);
|
27 |
+
unset($filelist[2]);
|
28 |
+
foreach ($filelist as $fl) {
|
29 |
+
if ($fl['date'] < $time) {
|
30 |
+
unlink(Mage::getBaseDir('var') . DS . "backups" . DS . $fl['file']);
|
31 |
+
}
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
}
|
app/code/community/Vgroup/Backupdel/Model/System/Config/Source/Backupdel/Values.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Vgroup_Backupdel_Model_System_Config_Source_Backupdel_Values
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
return array(
|
8 |
+
array(
|
9 |
+
'value' => '1',
|
10 |
+
'label' => 'One',
|
11 |
+
),
|
12 |
+
array(
|
13 |
+
'value' => '2',
|
14 |
+
'label' => 'Two',
|
15 |
+
),
|
16 |
+
array(
|
17 |
+
'value' => '3',
|
18 |
+
'label' => 'Three',
|
19 |
+
),
|
20 |
+
array(
|
21 |
+
'value' => '4',
|
22 |
+
'label' => 'Four',
|
23 |
+
),
|
24 |
+
array(
|
25 |
+
'value' => '5',
|
26 |
+
'label' => 'Five',
|
27 |
+
),
|
28 |
+
array(
|
29 |
+
'value' => '6',
|
30 |
+
'label' => 'Six',
|
31 |
+
),
|
32 |
+
array(
|
33 |
+
'value' => '7',
|
34 |
+
'label' => 'Seven',
|
35 |
+
),
|
36 |
+
array(
|
37 |
+
'value' => '8',
|
38 |
+
'label' => 'Eight',
|
39 |
+
),
|
40 |
+
array(
|
41 |
+
'value' => '9',
|
42 |
+
'label' => 'Nine',
|
43 |
+
),
|
44 |
+
array(
|
45 |
+
'value' => '10',
|
46 |
+
'label' => 'Ten',
|
47 |
+
),
|
48 |
+
);
|
49 |
+
}
|
50 |
+
}
|
app/code/community/Vgroup/Backupdel/controllers/IndexController.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
|
5 |
+
* News frontend controller
|
6 |
+
*
|
7 |
+
* @author Magento
|
8 |
+
|
9 |
+
*/
|
10 |
+
class Vgroup_Backupdel_IndexController extends Mage_Core_Controller_Front_Action {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Index action */
|
14 |
+
public function indexAction() {
|
15 |
+
exit('remove exit');
|
16 |
+
$filelist = array();
|
17 |
+
if ($handle = opendir(Mage::getBaseDir('var') . DS . "backups" . DS)) {
|
18 |
+
while ($entry = readdir($handle)) {
|
19 |
+
$filelist[] = array('file' => $entry, 'date' => strtotime(date("d-m-Y", filectime(Mage::getBaseDir('var') . DS . "backups" . DS . $entry))));
|
20 |
+
}
|
21 |
+
closedir($handle);
|
22 |
+
}
|
23 |
+
//backupdel/view/backupdel
|
24 |
+
$day = Mage::getStoreConfig('backupdel/view/backupdel');
|
25 |
+
$time = strtotime(date('d-m-Y', strtotime('-' . $day . ' day')));
|
26 |
+
//echo $time;
|
27 |
+
unset($filelist[0]);
|
28 |
+
unset($filelist[1]);
|
29 |
+
unset($filelist[2]);
|
30 |
+
foreach ($filelist as $fl) {
|
31 |
+
if ($fl['date'] < $time) {
|
32 |
+
unlink(Mage::getBaseDir('var') . DS . "backups" . DS . $fl['file']);
|
33 |
+
}
|
34 |
+
}
|
35 |
+
exit;
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
app/code/community/Vgroup/Backupdel/etc/adminhtml.xml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento admin config
|
5 |
+
*
|
6 |
+
* @author Magento
|
7 |
+
*/
|
8 |
+
-->
|
9 |
+
<config>
|
10 |
+
<acl>
|
11 |
+
<resources>
|
12 |
+
<admin>
|
13 |
+
<children>
|
14 |
+
<system>
|
15 |
+
<children>
|
16 |
+
<config>
|
17 |
+
<children>
|
18 |
+
<backupdel translate="title" module="vgroup_backupdel">
|
19 |
+
<title>Delete Backup</title>
|
20 |
+
</backupdel>
|
21 |
+
</children>
|
22 |
+
</config>
|
23 |
+
</children>
|
24 |
+
</system>
|
25 |
+
</children>
|
26 |
+
</admin>
|
27 |
+
</resources>
|
28 |
+
</acl>
|
29 |
+
</config>
|
app/code/community/Vgroup/Backupdel/etc/config.xml
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Module configuration
|
5 |
+
*
|
6 |
+
* @author Magento
|
7 |
+
*/
|
8 |
+
-->
|
9 |
+
<config>
|
10 |
+
<modules>
|
11 |
+
<Vgroup_Backupdel>
|
12 |
+
<version>1.0</version>
|
13 |
+
</Vgroup_Backupdel>
|
14 |
+
</modules>
|
15 |
+
<global>
|
16 |
+
<models>
|
17 |
+
<backupdel>
|
18 |
+
<class>Vgroup_Backupdel_Model</class>
|
19 |
+
<resourceModel>backupdel_resource</resourceModel>
|
20 |
+
</backupdel>
|
21 |
+
</models>
|
22 |
+
<helpers>
|
23 |
+
<backupdel>
|
24 |
+
<class>Vgroup_Backupdel_Helper</class>
|
25 |
+
</backupdel>
|
26 |
+
</helpers>
|
27 |
+
<blocks>
|
28 |
+
<backupdel>
|
29 |
+
<class>Vgroup_Backupdel_Block</class>
|
30 |
+
</backupdel>
|
31 |
+
</blocks>
|
32 |
+
</global>
|
33 |
+
<frontend>
|
34 |
+
<routers>
|
35 |
+
<vgroup_backupdel>
|
36 |
+
<use>standard</use>
|
37 |
+
<args>
|
38 |
+
<module>Vgroup_Backupdel</module>
|
39 |
+
<frontName>backupdel</frontName>
|
40 |
+
</args>
|
41 |
+
</vgroup_backupdel>
|
42 |
+
</routers>
|
43 |
+
</frontend>
|
44 |
+
<admin>
|
45 |
+
<routers>
|
46 |
+
<adminhtml>
|
47 |
+
<args>
|
48 |
+
<modules>
|
49 |
+
<Vgroup_Backupdel before="Mage_Adminhtml">Vgroup_Backupdel_Adminhtml</Vgroup_Backupdel>
|
50 |
+
</modules>
|
51 |
+
</args>
|
52 |
+
</adminhtml>
|
53 |
+
</routers>
|
54 |
+
</admin>
|
55 |
+
<default>
|
56 |
+
<backupdel>
|
57 |
+
<view>
|
58 |
+
<backupdel>00</backupdel>
|
59 |
+
</view>
|
60 |
+
</backupdel>
|
61 |
+
</default>
|
62 |
+
<crontab>
|
63 |
+
<jobs>
|
64 |
+
<vgroup_backupdel_send>
|
65 |
+
<schedule>
|
66 |
+
<cron_expr>0 23 * * *</cron_expr>
|
67 |
+
</schedule>
|
68 |
+
<run>
|
69 |
+
<model>backupdel/observer::method</model>
|
70 |
+
</run>
|
71 |
+
</vgroup_backupdel_send>
|
72 |
+
</jobs>
|
73 |
+
</crontab>
|
74 |
+
</config>
|
app/code/community/Vgroup/Backupdel/etc/system.xml
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento admin configiguration section config
|
5 |
+
*
|
6 |
+
* @author Magento
|
7 |
+
*/
|
8 |
+
-->
|
9 |
+
<config>
|
10 |
+
<sections>
|
11 |
+
<backupdel>
|
12 |
+
<class>separator-top</class>
|
13 |
+
<label>Delete Backup</label>
|
14 |
+
<tab>general</tab>
|
15 |
+
<frontend_type>text</frontend_type>
|
16 |
+
<sort_order>500</sort_order>
|
17 |
+
<show_in_default>1</show_in_default>
|
18 |
+
<show_in_website>1</show_in_website>
|
19 |
+
<show_in_store>1</show_in_store>
|
20 |
+
<groups>
|
21 |
+
<view translate="label">
|
22 |
+
<label>Delete Backup</label>
|
23 |
+
<frontend_type>text</frontend_type>
|
24 |
+
<sort_order>10</sort_order>
|
25 |
+
<show_in_default>1</show_in_default>
|
26 |
+
<show_in_website>1</show_in_website>
|
27 |
+
<show_in_store>1</show_in_store>
|
28 |
+
<fields>
|
29 |
+
<backupdel translate="label comment">
|
30 |
+
<label>Number Of Days</label>
|
31 |
+
<comment>Select number of days to keep the backup, earlier backup will be deleted.</comment>
|
32 |
+
<frontend_type>select</frontend_type>
|
33 |
+
<source_model>backupdel/system_config_source_backupdel_values</source_model>
|
34 |
+
<sort_order>30</sort_order>
|
35 |
+
<show_in_default>1</show_in_default>
|
36 |
+
<show_in_website>0</show_in_website>
|
37 |
+
<show_in_store>0</show_in_store>
|
38 |
+
</backupdel>
|
39 |
+
</fields>
|
40 |
+
</view>
|
41 |
+
</groups>
|
42 |
+
</backupdel>
|
43 |
+
</sections>
|
44 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Vgroup_Backupdel</name>
|
4 |
+
<version>1.9.2.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>This extension help you to automatic delete your old backup created by system by keeping selected days backup.</summary>
|
10 |
+
<description>We help you to automatically delete your old backup. You have to select number of days from admin section to keep your backup for days. Once You selected number of days, this extension will automatically delete your all backup by keeping backup for selected days and later. This is done by running cron every day. Once select number of days for backup delete and let extension do all the process.</description>
|
11 |
+
<notes>Initial Release</notes>
|
12 |
+
<authors><author><name>V Group Inc</name><user>akhilesh_vgroup</user><email>akhilesh.chourey@vgroup.net</email></author></authors>
|
13 |
+
<date>2016-08-12</date>
|
14 |
+
<time>08:09:39</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Vgroup"><dir name="Backupdel"><dir name="Helper"><file name="Data.php" hash="5d7dbde06f4ed2a500dbd3d381390b82"/></dir><dir name="Model"><file name="Backupdel.php" hash="66bbd9f6a7e458044064d133d6c84068"/><file name="Observer.php" hash="99da42d1fbcb1f7af202368458c3858e"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Backupdel"><file name="Values.php" hash="142dae5c5505393ca668ef33bbc7aea3"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="ca8b35d095c561c8be743a0096033c51"/></dir><dir name="etc"><file name="adminhtml.xml" hash="35dc4c40927d75b71846eb39f1623134"/><file name="config.xml" hash="065bca89eb17f7e985bb51c2ce425551"/><file name="system.xml" hash="6329b4fef7b1fb35710cf63378ab95b8"/></dir></dir></dir></target><target name="mageetc"><dir name="module"><file name="Vgroup_Backupdel.xml" hash=""/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.3.5</min><max>5.5.12</max></php></required></dependencies>
|
18 |
+
</package>
|