public/wordpress/wp-content/plugins/backupbuddy/destinations/live/live_periodic.php
/* backup_catalog()
	 *
	 * Backs up the catalog file for restore if it gets corrupted (eg due to process being killed mid-write).
	 *
	 */
backup_catalog()
Backs up the catalog file for restore if it gets corrupted .
backup_catalog () Backs up the catalog file for restore if it gets corrupted .
public static function backup_catalog() {
		pb_backupbuddy::status( 'details', 'About to backup catalog file.' );
		$catalog_file = backupbuddy_core::getLogDirectory() . 'live/catalog-' . pb_backupbuddy::$options['log_serial'] . '.txt';
		if ( ! file_exists( $catalog_file ) ) {
			return false;
		}
		if ( false === @touch( $catalog_file . '.bak.lock' ) ) {
			pb_backupbuddy::status( 'error', 'Error #43849344: Unable to create catalog backup lock file.' );
			return false;
		}
		if ( false === @copy( $catalog_file, $catalog_file . '.bak' ) ) {
			pb_backupbuddy::status( 'error', 'Error #238932893: Unable to backup catalog file.' );
			return false;
		}
		if ( false === @unlink( $catalog_file . '.bak.lock' ) ) {
			pb_backupbuddy::status( 'error', 'Error #43434549: Unable to remove catalog backup lock file.' );
			return false;
		}
		pb_backupbuddy::status( 'details', 'Catalog file backed up.' );
		return true;
	}
public static function backup_catalog ( ) { pb_backupbuddy :: status ( 'details' , 'About to backup catalog file.' ) ; $ catalog_file = backupbuddy_core :: getLogDirectory ( ) . 'live/catalog-' . pb_backupbuddy :: $ options [ 'log_serial' ] . '.txt' ; if ( ! file_exists ( $ catalog_file ) ) { return false ; } if ( false === @ touch ( $ catalog_file . '.bak.lock' ) ) { pb_backupbuddy :: status ( 'error' , 'Error #43849344: Unable to create catalog backup lock file.' ) ; return false ; } if ( false === @ copy ( $ catalog_file , $ catalog_file . '.bak' ) ) { pb_backupbuddy :: status ( 'error' , 'Error #238932893: Unable to backup catalog file.' ) ; return false ; } if ( false === @ unlink ( $ catalog_file . '.bak.lock' ) ) { pb_backupbuddy :: status ( 'error' , 'Error #43434549: Unable to remove catalog backup lock file.' ) ; return false ; } pb_backupbuddy :: status ( 'details' , 'Catalog file backed up.' ) ; return true ; }
backup_catalog()
 Backs up the catalog file for restore if it gets corrupted (eg due to process being killed mid-write).
backup_catalog () Backs up the catalog file for restore if it gets corrupted ( eg due to process being killed mid - write ) .
// Create lock file. If this file exists when restoring a backed up catalog then we cannot trust the backup. // Make copy of catalog file. // Remove lock file since copy succeeded.