Archive directory
Pack files from the specified directory into a tar archive
- Parameters
- Advanced call ?
Function ArchiveDirectory(Val Directory, Val ArchivePath = "", Val Settings = Undefined) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Directory | --src | String, BinaryData | ✔ | Path to the directory or data description for packing |
| ArchivePath | --dest | String | ✖ | Path to save the archive. To binary data if not filled |
| Settings | --settings | Map Of KeyAndValue | ✖ | Additional settings. See GetArchivingSettingsStructure |
Returns
BinaryData, Map Of KeyAndValue - Execution information or binary archive data
| Parameter | Description |
|---|---|
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
tip
Parameters with Binary data type can also accept file paths on disk and URLs
1C:Enterprise/OneScript code example
SourceDirectory = Parameters["Tar_SourceDir"];
ArchivePath = Parameters["Tar_ArchivePath"];
Result = OPI_Tar.ArchiveDirectory(SourceDirectory, ArchivePath);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint tar ArchiveDirectory \
--src "{'entries':[{'name':'readme.txt','directory':false,'from_path':true,'path':'/tmp//opi_tar_63920079983725/src/readme.txt'},{'name':'docs','directory':true,'entries':[{'name':'note.txt','directory':false,'from_path':true,'path':'/tmp//opi_tar_63920079983725/src/docs/note.txt'}]}]}"
:: JSON data can also be passed as a path to a .json file
oint tar ArchiveDirectory ^
--src "{'entries':[{'name':'readme.txt','directory':false,'from_path':true,'path':'/tmp//opi_tar_63920079983725/src/readme.txt'},{'name':'docs','directory':true,'entries':[{'name':'note.txt','directory':false,'from_path':true,'path':'/tmp//opi_tar_63920079983725/src/docs/note.txt'}]}]}"
Result
{
"result": true
}