Function __global->tar_add_folder_incremental

Definitions

sources/tar.php

  • Add a folder to the TAR archive, however only store files modified after a threshold time. It is incremental (incremental backup), by comparing against a threshold before adding a file (threshold being time of last backup).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
&$resource array Yes No required parameter N/A N/A The TAR file handle
$log_file ?resource No No required parameter N/A N/A The logfile to write to (null: no logging)
$path PATH No No required parameter N/A N/A The full path to the folder to add
$threshold TIME No No required parameter N/A N/A The threshold time
$max_size ?integer No No required parameter N/A N/A The maximum file size to add (null: no limit)
$subpath PATH No No Blank (empty string) N/A N/A The subpath relative to the path (should be left as the default '', as this is used for the recursion to distinguish the adding base path from where it's currently looking)
$ignore_bitmask ?integer No No 0 N/A N/A Bitmask of extra stuff to ignore (see IGNORE_* constants) (null: don't ignore anything)
$callback ?mixed No No Null N/A N/A Callback to run on each iteration (null: none)

Returns

  • A list of maps that stores 'path', 'mode' and 'size', for each newly added file in the archive
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Add a folder to the TAR archive, however only store files modified after a threshold time. It is incremental (incremental backup), by comparing against a threshold before adding a file (threshold being time of last backup).
 *
 * @param  array $resource The TAR file handle
 * @param  ?resource $log_file The logfile to write to (null: no logging)
 * @param  PATH $path The full path to the folder to add
 * @param  TIME $threshold The threshold time
 * @param  ?integer $max_size The maximum file size to add (null: no limit)
 * @param  PATH $subpath The subpath relative to the path (should be left as the default '', as this is used for the recursion to distinguish the adding base path from where it's currently looking)
 * @param  ?integer $ignore_bitmask Bitmask of extra stuff to ignore (see IGNORE_* constants) (null: don't ignore anything)
 * @param  ?mixed $callback Callback to run on each iteration (null: none)
 * @return array A list of maps that stores 'path', 'mode' and 'size', for each newly added file in the archive
 */

function tar_add_folder_incremental(array &$resource, $log_file, string $path, int $threshold, ?int $max_size, string $subpath = '', ?int $ignore_bitmask = 0, $callback = null) : array