保护备份的数据库

Step 1:

– The .htaccess doesn’t provide a protection to anyone from downloading the backups.

– The .htaccess doesn’t prevent search engines from entering this folder so:

– Open .htaccess which in your backup folder and enter this code:

<Files “*.sql”>
Deny from all
</Files>
<Files “*.gz”>
Deny from all
</Files>

Now you prevent the search engines from entering and indexing this folder and you prevent anyone to download these backups even you.

Step 2:

– When you take a backup it saved it in a unique format like this:

[imya_BD] _ [e-a-ta] _ [time]. sql


Or

[imya_BD] _ [e-a-ta] _ [time]. sql.gz

For example:

datalife_2008-06-14_18-10.sql


Or

datalife_2008-06-14_18-10.sql.gz

– So to prevent someone from guessing the prefix then downloading the backup follow me:

– Open:

engine/inc/dumper.php

– Find:

$name = $db . ‘_’ . date(“Y-m-d_H-i”);

– Replace it with:

$pref = time();
$name = $pref . ‘_’ . $db . ‘_’ . date(“Y-m-d_H-i-s”);

Now it’s impossible for someone to guess the prefix.

Step 3:

– Create a password for the backup directory from your cPanel.

Now it’s impossible for someone to steal your backup.

订阅评论
提醒
guest
0 评论
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x