Backup Data RotorCMS - Visavi.net
https://visavi.net/
RSS - Visavi.net
https://visavi.net/assets/img/images/logo_small.png
RSS - Visavi.net
https://visavi.net/
[email protected] (admin)
[email protected] (admin)
Wed, 18 Dec 2024 21:09:54 +0300
-
Not run php script
https://visavi.net/topics/15996/292638
Backup Data RotorCMS
hugo
Wed, 22 Dec 2010 16:43:11 +0300
Сообщения
https://visavi.net/topics/15996/292638
-
up@ what N70 not support copy paste??
https://visavi.net/topics/15996/286432
Backup Data RotorCMS
nybiru
Fri, 10 Dec 2010 06:38:28 +0300
Сообщения
https://visavi.net/topics/15996/286432
-
I need write in php please
https://visavi.net/topics/15996/286012
Backup Data RotorCMS
hugo
Thu, 09 Dec 2010 04:05:16 +0300
Сообщения
https://visavi.net/topics/15996/286012
-
please .zip code
https://visavi.net/topics/15996/285560
Backup Data RotorCMS
Удаленный
Wed, 08 Dec 2010 14:16:27 +0300
Сообщения
https://visavi.net/topics/15996/285560
-
Please write code in php
https://visavi.net/topics/15996/285480
Backup Data RotorCMS
hugo
Wed, 08 Dec 2010 10:47:54 +0300
Сообщения
https://visavi.net/topics/15996/285480
-
Zip code php please
https://visavi.net/topics/15996/280625
Backup Data RotorCMS
hugo
Mon, 29 Nov 2010 15:04:04 +0300
Сообщения
https://visavi.net/topics/15996/280625
-
<pre class="prettyprint"><?php
define ("FILES_TO_KEEP", 5);
define ("BACKUP_PERIOD", 86400); // сутки
define ("DATABASE_CONF", 'mysql://mysql_login:mysql_password@mysql_server/database_name');
define ("BACKUP_FOLDER", './backup' );
error_reporting(0);
function cmp_file_times($t1, $t2) {
if ($t1['t'] == $t2['t']) return 0;
return ($t1['t'] > $t2['t']) ? 1 : -1;
}
function backup() {
global $now;
$file = BACKUP_FOLDER."/backup-".date("d-m-Y_H-i-s", $now).".sql";
$db = parse_url(DATABASE_CONF);
$db['path'] = substr($db['path'], 1);
$q = "mysqldump -u".$db['user']." -p".$db['pass']." -h".$db['host']." ".$db['path']." > ";
exec($q.$file."; gzip -f ".$file); // убедитесь что функции "mysqldump" и "gzip" доступны в консоли.
}
$now = time();
clearstatcache();
$b_dir = dir(BACKUP_FOLDER);
$b_files = array();
while($file = $b_dir->read()) {
if (preg_match("/^backup-(\d+)-(\d+)-(\d+)_(\d+)-(\d+)-(\d+)/i", $file, $a)) {
array_push($b_files, array('n' => $file, 't' => mktime($a[4], $a[5], $a[6], $a[2], $a[1], $a[3])));
}
}
$b_dir->close();
$b_count_files = count($b_files);
if ($b_count_files) {
usort($b_files, "cmp_file_times");
if ($b_files[$b_count_files - 1]['t'] <= $now - BACKUP_PERIOD) {
if ($b_count_files >= FILES_TO_KEEP) {
for ($i = 0; $i < $b_count_files - FILES_TO_KEEP + 1; $i ++) {
unlink(BACKUP_FOLDER."/".$b_files[$i]['n']);
}
}
backup();
}
}else {
backup();
}
?></pre>
https://visavi.net/topics/15996/280324
Backup Data RotorCMS
Славик
Sun, 28 Nov 2010 18:03:46 +0300
Сообщения
https://visavi.net/topics/15996/280324
-
while only with help phpmyadmin
https://visavi.net/topics/15996/280312
Backup Data RotorCMS
mozzzg
Sun, 28 Nov 2010 17:33:47 +0300
Сообщения
https://visavi.net/topics/15996/280312
-
Share backup data mysql rotorcms!
https://visavi.net/topics/15996/280245
Backup Data RotorCMS
KareelKun
Sun, 28 Nov 2010 15:30:23 +0300
Сообщения
https://visavi.net/topics/15996/280245