mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
1b0d1a4450
* wip * wip * wip * Clean * fix test * clean * fix test * fix test
26 lines
920 B
C++
26 lines
920 B
C++
#pragma once
|
|
|
|
#include <optional>
|
|
|
|
namespace Poco { class Path; }
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/** Creates a local (at the same mount point) backup (snapshot) directory.
|
|
*
|
|
* In the specified destination directory, it creates a hard links on all source-directory files
|
|
* and in all nested directories, with saving (creating) all relative paths;
|
|
* and also `chown`, removing the write permission.
|
|
*
|
|
* This protects data from accidental deletion or modification,
|
|
* and is intended to be used as a simple means of protection against a human or program error,
|
|
* but not from a hardware failure.
|
|
*
|
|
* If max_level is specified, than only files which depth relative source_path less or equal max_level will be copied.
|
|
* So, if max_level=0 than only direct file child are copied.
|
|
*/
|
|
void localBackup(const Poco::Path & source_path, const Poco::Path & destination_path, std::optional<size_t> max_level = {});
|
|
|
|
}
|