public/wordpress/wp-content/plugins/backupbuddy/classes/housekeeping.php
/* run_periodic()
	 *
	 * Periodic housekeeping cleanup function to clean up after BackupBuddy. Clean up orphaned files, data structure,
	 * old log files, etc. Also verifies anti-directory browsing files exist in expected locations and any potential
	 * problems are handled.
	 *
	 * @param	int		$backup_age_limit		Maximum age (in seconds) to allow logs or other transient files/structures to exist after no longer needed. Default: 172800 (48 hours).
	 * @param	bool	$die_on_fail			Whether or not to die fatally if something goes wrong (such as unable to make anti-directory browsing files).
	 *
	 */
run_periodic()
Periodic housekeeping cleanup function to clean up after BackupBuddy. Clean up orphaned files, data structure,
old log files, etc. Also verifies anti-directory browsing files exist in expected locations and any potential
problems are handled.

@param       int             $backup_age_limit               Maximum age (in seconds) to allow logs or other transient files/structures to exist after no longer needed.
run_periodic () Periodic housekeeping cleanup function to clean up after BackupBuddy . Clean up orphaned files data structure old log files etc . Also verifies anti - directory browsing files exist in expected locations and any potential problems are handled . @param int $backup_age_limit Maximum age ( in seconds ) to allow logs or other transient files / structures to exist after no longer needed .
public static function run_periodic( $backup_age_limit = 172800, $die_on_fail = true ) {
		if ( is_multisite() ) { 
			if ( ! is_main_site() ) {
				return;
			}
		}
		pb_backupbuddy::status( 'message', 'Starting periodic housekeeeping procedure for BackupBuddy v' . pb_backupbuddy::settings( 'version' ) . '.' );
		require_once( pb_backupbuddy::plugin_path() . '/classes/core.php' );
		require_once( pb_backupbuddy::plugin_path() . '/classes/fileoptions.php' );
		if ( !isset( pb_backupbuddy::$options ) ) {
			pb_backupbuddy::load();
		}
		self::no_recent_backup_reminder();
		backupbuddy_core::verify_directories( $skipTempGeneration = true ); 
		self::check_high_security_mode( $die_on_fail );
		self::remove_importbuddy_file();
		self::remove_importbuddy_dir();
		self::remove_dat_file_from_root();
		self::remove_rollback_files();
		self::remove_old_fileoptions_locks();
		self::cleanup_temp_dir( $backup_age_limit );
		self::remove_temp_zip_dirs( $backup_age_limit );
		self::process_timed_out_backups();
		self::process_timed_out_sends();
		self::validate_bb_schedules_in_wp();
		self::backup_bb_settings();
		self::remove_temp_tables( '', $backup_age_limit );
		self::remove_wp_schedules_with_no_bb_schedule();
		self::trim_old_notifications();
		self::trim_remote_send_stats();
		self::s3_cancel_multipart_pieces();
		self::s32_cancel_multipart_pieces();
		self::cleanup_local_destination_temp();
		self::purge_logs();
		self::purge_large_logs();
		self::clear_cron_send();
		self::cleanup_transients( false ); 
		self::schedule_php_runtime_tests();
		self::schedule_php_memory_tests();
		@clearstatcache(); 
		pb_backupbuddy::status( 'message', 'Finished periodic housekeeping cleanup procedure.' );
	}
public static function run_periodic ( $ backup_age_limit = 172800 , $ die_on_fail = true ) { if ( is_multisite ( ) ) { if ( ! is_main_site ( ) ) { return ; } } pb_backupbuddy :: status ( 'message' , 'Starting periodic housekeeeping procedure for BackupBuddy v' . pb_backupbuddy :: settings ( 'version' ) . '.' ) ; require_once ( pb_backupbuddy :: plugin_path ( ) . '/classes/core.php' ) ; require_once ( pb_backupbuddy :: plugin_path ( ) . '/classes/fileoptions.php' ) ; if ( ! isset ( pb_backupbuddy :: $ options ) ) { pb_backupbuddy :: load ( ) ; } self :: no_recent_backup_reminder ( ) ; backupbuddy_core :: verify_directories ( $ skipTempGeneration = true ) ; self :: check_high_security_mode ( $ die_on_fail ) ; self :: remove_importbuddy_file ( ) ; self :: remove_importbuddy_dir ( ) ; self :: remove_dat_file_from_root ( ) ; self :: remove_rollback_files ( ) ; self :: remove_old_fileoptions_locks ( ) ; self :: cleanup_temp_dir ( $ backup_age_limit ) ; self :: remove_temp_zip_dirs ( $ backup_age_limit ) ; self :: process_timed_out_backups ( ) ; self :: process_timed_out_sends ( ) ; self :: validate_bb_schedules_in_wp ( ) ; self :: backup_bb_settings ( ) ; self :: remove_temp_tables ( '' , $ backup_age_limit ) ; self :: remove_wp_schedules_with_no_bb_schedule ( ) ; self :: trim_old_notifications ( ) ; self :: trim_remote_send_stats ( ) ; self :: s3_cancel_multipart_pieces ( ) ; self :: s32_cancel_multipart_pieces ( ) ; self :: cleanup_local_destination_temp ( ) ; self :: purge_logs ( ) ; self :: purge_large_logs ( ) ; self :: clear_cron_send ( ) ; self :: cleanup_transients ( false ) ; self :: schedule_php_runtime_tests ( ) ; self :: schedule_php_memory_tests ( ) ; @ clearstatcache ( ) ; pb_backupbuddy :: status ( 'message' , 'Finished periodic housekeeping cleanup procedure.' ) ; }
run_periodic()
 Periodic housekeeping cleanup function to clean up after BackupBuddy.
run_periodic () Periodic housekeeping cleanup function to clean up after BackupBuddy .
// For Multisite only run on main Network site. // Top priority. Security related or otherwise crucial to run first. // Verify directory existance and anti-directory browsing is in place everywhere. // Potential large file/dir cleanup. May bog down site. // Robustness -- handle re-processing timeouts, verifying schedules, etc. // Backup settings to file to help prevent loss of settings due to database problems. pb_backupbuddy::load() will look for this file if default settings are faulty/missing. // More minor cleanup. // Don't purge unexpiring transients. // PHP tests. // Clears file info stat cache.