Plugin Directory

Changeset 718474


Ignore:
Timestamp:
05/26/2013 02:41:18 PM (13 years ago)
Author:
6Scan
Message:

Improved backup processes

Location:
6scan-protection/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 6scan-protection/trunk/6scan.php

    r709128 r718474  
    55Description: 6Scan Security provides enterprise-grade security with a firewall, automatic backup, analytics and much more.
    66Author: 6Scan
    7 Version: 3.0.3
     7Version: 3.0.4
    88Author URI: http://www.6scan.com
    99*/
  • 6scan-protection/trunk/admin/includes/common.php

    r709128 r718474  
    44    die( 'No direct access allowed' );
    55
    6 define ( 'SIXSCAN_VERSION' ,                            '3.0.3.0' );
     6define ( 'SIXSCAN_VERSION' ,                            '3.0.4.0' );
    77define ( 'SIXSCAN_HTACCESS_VERSION' ,                   '1' );
    88
  • 6scan-protection/trunk/modules/backup/backup_func.php

    r575931 r718474  
    141141    $tmp_random_seed = date("Y-m-d-H-i-s") . "_" . substr( md5 ( rand( 0, 32000 )) , 0 , 10 ); 
    142142    $temp_file_archived = get_temp_dir() . "files_backup_$tmp_random_seed.tar.gz";
    143     $tmp_backup_dir = "/tmp/6scan_backup_$tmp_random_seed/";
     143    $tmp_backup_dir = "/tmp/6scan_backup_$tmp_random_seed";
    144144
    145145    /*  If a previous file was not deleted from some reason, delete it now */
    146     sixscan_backup_func_delete_previous( SIXSCAN_BACKUP_LAST_FS_NAME , $temp_file_archived );
     146    sixscan_backup_func_delete_previous( SIXSCAN_BACKUP_LAST_FS_NAME , array( $temp_file_archived, $tmp_backup_dir ) );
    147147
    148148    /* Prepare backup directory */ 
    149     $backup_cmd = "mkdir $tmp_backup_dir; cp -r " . ABSPATH . " $tmp_backup_dir";
     149    $backup_cmd = "mkdir $tmp_backup_dir; cp -r " . ABSPATH . " $tmp_backup_dir/";
    150150    ob_start(); passthru( $backup_cmd ); ob_end_clean();
    151151
    152152    /* Linux backup is using tar.gz */     
    153     $backup_cmd = "tar -czf $temp_file_archived $tmp_backup_dir 2>&1";
     153    $backup_cmd = "tar -czf $temp_file_archived $tmp_backup_dir/ 2>&1";
    154154    $ret_val = 0;
    155155
     
    157157    ob_start(); passthru( $backup_cmd , $ret_val ); $tar_output = ob_get_contents(); ob_clean();
    158158
    159     $cleanup_cmd = "rm -rf $tmp_backup_dir 2>&1";
    160     passthru( $cleanup_cmd );
     159    sixscan_backup_func_clear_file( $tmp_backup_dir );
    161160
    162161    /* Check for error that might've occured while running tar. Retval 0 is ok */
     
    224223
    225224    $last_db_backup_name = get_option( $backup_type );
    226     if ( file_exists( $last_db_backup_name ) )
    227         @unlink( $last_db_backup_name );
     225
     226    if ( is_array( $last_db_backup_name) ){
     227        foreach ( $last_db_backup_name  as $one_file ){
     228            sixscan_backup_func_clear_file( $one_file );
     229        }
     230    }
     231    else {
     232        sixscan_backup_func_clear_file( $last_db_backup_name );
     233    }
     234
    228235    update_option( $backup_type , $new_backup_filename );
    229236}
    230237
     238function sixscan_backup_func_clear_file( $fname ){
     239    if ( strlen( $fname ) > 0 ){
     240        $cleanup_cmd = "rm -rf $fname 2>&1";
     241        passthru( $cleanup_cmd );
     242    }
     243}
    231244
    232245/* Backup the db OR just a table */
  • 6scan-protection/trunk/readme.txt

    r709128 r718474  
    11=== 6Scan Security ===
    22Contributors: 6Scan
    3 Version: 3.0.3
     3Version: 3.0.4
    44Tags: security,secure,wordpress security,firewall,antivirus,security plugin,securty,protection,anti-hack,hack,scan,exploit,anti-virus
    55Requires at least: 3.0.0
     
    309309* Few minor bugs fixed
    310310
     311= 3.0.4 =
     312* Improved backup processes
     313
    311314== Upgrade Notice ==
    312315
Note: See TracChangeset for help on using the changeset viewer.