Compress
Compress and uncompress files in ZIP, TAR, TAR.GZ, TAR.BZ2, TAR.XZ, GZIP and JAR formats, with safe extraction. Typical uses: zip export files before sending them, unpack an archive received from a partner.
compress zipcompress unzipcompress tarcompress untarcompress tarGzcompress untarGzcompress tarBz2compress untarBz2compress jarcompress unjarcompress gzcompress ungzcompress bz2compress unbz2compress xzcompress xzcompress unxzcompress unxzcompress tarXzcompress tarXzcompress untarXzcompress untarXzcompress 7zcompress 7zcompress un7zcompress un7z

compress zip <in> <out>


Description

    Compress into the ZIP format

Parameters

    in:   The path to the input file - String - required
    out:   The path to the output file - String - required
admin
compress zip "archives/logs/cur_log.sql" "archives/logs/cur_log.sql.zip";
mentdb
1
Used in use cases (3 recipes)

    Files & archives manager › Back up a project folder in five archive formats
    Integrator & ETL developer › Nightly export pack: CSV, Excel and PDF in an outbox connection
    Files & archives manager › Delivery package with a SHA-256 manifest, verified after unzip
Often used with

    file mkdir  ·  file size  ·  compress unzip  ·  file count_lines  ·  file create  ·  file dir_list_regex  ·  file load  ·  json parse_array

compress unzip <in> <dir>


Description

    Uncompress from the ZIP format

Parameters

    in:   The path to the input file - String - required
    dir:   The path to the directory - String - required
admin
compress unzip "archives/logs/cur_log.sql.zip" "archives/logs";
mentdb
1
Used in use cases (3 recipes)

    XML, HTML & Word integrator › Fill a Word template, then check the result as XML
    Files & archives manager › Back up a project folder in five archive formats
    Files & archives manager › Delivery package with a SHA-256 manifest, verified after unzip
Often used with

    file load  ·  file size  ·  compress zip  ·  file create  ·  file dir_list  ·  file mkdir  ·  string regexp_replace  ·  string trim

compress tar <in> <out>


Description

    Compress into the TAR format

Parameters

    in:   The path to the input file - String - required
    out:   The path to the output file - String - required
admin
compress tar "archives/logs/cur_log.sql" "archives/logs/cur_log.sql.tar";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Back up a project folder in five archive formats
Often used with

    compress bz2  ·  compress jar  ·  compress tarBz2  ·  compress tarGz  ·  compress unbz2  ·  compress unjar  ·  compress untar  ·  compress untarBz2

compress untar <in> <dir>


Description

    Uncompress from the TAR format

Parameters

    in:   The path to the input file - String - required
    dir:   The path to the directory - String - required
admin
compress untar "archives/logs/cur_log.sql.tar" "archives/logs";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Back up a project folder in five archive formats
Often used with

    compress bz2  ·  compress jar  ·  compress tar  ·  compress tarBz2  ·  compress tarGz  ·  compress unbz2  ·  compress unjar  ·  compress untarBz2

compress tarGz <in> <out>


Description

    Compress into the TAR.GZ format

Parameters

    in:   The path to the input file - String - required
    out:   The path to the output file - String - required
admin
compress tarGz "archives/logs/cur_log.sql" "archives/logs/cur_log.sql.tar.gz";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Back up a project folder in five archive formats
Often used with

    compress bz2  ·  compress jar  ·  compress tar  ·  compress tarBz2  ·  compress unbz2  ·  compress unjar  ·  compress untar  ·  compress untarBz2

compress untarGz <in> <dir>


Description

    Uncompress from the TAR.GZ format

Parameters

    in:   The path to the input file - String - required
    dir:   The path to the directory - String - required
admin
compress untarGz "archives/logs/cur_log.sql.tar.gz" "archives/logs";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Back up a project folder in five archive formats
Often used with

    compress bz2  ·  compress jar  ·  compress tar  ·  compress tarBz2  ·  compress tarGz  ·  compress unbz2  ·  compress unjar  ·  compress untar

compress tarBz2 <in> <out>


Description

    Compress into the TAR.BZ2 format

Parameters

    in:   The path to the input file - String - required
    out:   The path to the output file - String - required
admin
compress tarBz2 "archives/logs/cur_log.sql" "archives/logs/cur_log.sql.tar.bz2";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Back up a project folder in five archive formats
Often used with

    compress bz2  ·  compress jar  ·  compress tar  ·  compress tarGz  ·  compress unbz2  ·  compress unjar  ·  compress untar  ·  compress untarBz2

compress untarBz2 <in> <dir>


Description

    Uncompress from the TAR.BZ2 format

Parameters

    in:   The path to the input file - String - required
    dir:   The path to the directory - String - required
admin
compress untarBz2 "archives/logs/cur_log.sql.tar.bz2" "archives/logs";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Back up a project folder in five archive formats
Often used with

    compress bz2  ·  compress jar  ·  compress tar  ·  compress tarBz2  ·  compress tarGz  ·  compress unbz2  ·  compress unjar  ·  compress untar

compress jar <in> <out>


Description

    Compress into the JAR format

Parameters

    in:   The path to the input file - String - required
    out:   The path to the output file - String - required
admin
compress jar "archives/logs/cur_log.sql" "archives/logs/cur_log.sql.jar";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Back up a project folder in five archive formats
Often used with

    compress bz2  ·  compress tar  ·  compress tarBz2  ·  compress tarGz  ·  compress unbz2  ·  compress unjar  ·  compress untar  ·  compress untarBz2

compress unjar <in> <dir>


Description

    Uncompress from the JAR format

Parameters

    in:   The path to the input file - String - required
    dir:   The path to the directory - String - required
admin
compress unjar "archives/logs/cur_log.sql.jar" "archives/logs";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Back up a project folder in five archive formats
Often used with

    compress bz2  ·  compress jar  ·  compress tar  ·  compress tarBz2  ·  compress tarGz  ·  compress unbz2  ·  compress untar  ·  compress untarBz2

compress gz <inFile> <outFile>


Description

    Compress into the GZIP format

Parameters

    inFile:   The path to the input file - String - required
    outFile:   The path to the output file - String - required
admin
compress gz "archives/logs/cur_log.sql" "archives/logs/cur_log.sql.gz";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Write a daily log, then rotate it into a gzip archive
Often used with

    compress ungz  ·  file count_lines  ·  file delete  ·  file dir_list_regex  ·  file exist  ·  file mkdir  ·  file reader_close  ·  file reader_get_line

compress ungz <inFile> <outFile>


Description

    Uncompress from the GZIP format

Parameters

    inFile:   The path to the input file - String - required
    outFile:   The path to the file - String - required
admin
compress ungz "archives/logs/cur_log.sql.gz" "archives/logs/cur_log.sql";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Write a daily log, then rotate it into a gzip archive
Often used with

    compress gz  ·  file count_lines  ·  file delete  ·  file dir_list_regex  ·  file exist  ·  file mkdir  ·  file reader_close  ·  file reader_get_line

compress bz2 <inFile> <outFile>


Description

    Compress into the BZIP2 format

Parameters

    inFile:   The path to the input file - String - required
    outFile:   The path to the output file - String - required
admin
compress bz2 "archives/logs/cur_log.sql" "archives/logs/cur_log.sql.bz2";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Back up a project folder in five archive formats
Often used with

    compress jar  ·  compress tar  ·  compress tarBz2  ·  compress tarGz  ·  compress unbz2  ·  compress unjar  ·  compress untar  ·  compress untarBz2

compress unbz2 <inFile> <outFile>


Description

    Uncompress from the BZIP2 format

Parameters

    inFile:   The path to the input file - String - required
    outFile:   The path to the file - String - required
admin
compress unbz2 "archives/logs/cur_log.sql.bz2" "archives/logs/cur_log.sql";
mentdb
1
Used in use cases (1 recipe)

    Files & archives manager › Back up a project folder in five archive formats
Often used with

    compress bz2  ·  compress jar  ·  compress tar  ·  compress tarBz2  ·  compress tarGz  ·  compress unjar  ·  compress untar  ·  compress untarBz2

compress xz <source_path> <out_path>


Description

    Compress a file into the xz format (LZMA2, level 6, CRC64 check, readable by xz and 7-Zip). Returns {out_path, bytes_in, bytes_out, level}. An existing out_path is an error

Parameters

    source_path:   The file to compress - String - required
    out_path:   The .xz file to write - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; csv write "tmp/tuto_ops/logs/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; csv write "tmp/tuto_ops/logs/old/day0.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}]"; -> "[res]" (compress xz "tmp/tuto_ops/logs/day1.csv" "tmp/tuto_ops/day1.csv.xz"); file delete "tmp/tuto_ops"; [res]
mentdb
{"out_path": "tmp/tuto_ops/day1.csv.xz", "bytes_in": 113, "bytes_out": 144, "level": 6}

compress xz <source_path> <out_path> <json_params>


Description

    Compress a file into xz with parameters: level (0 to 9, 6 by default), overwrite (false)

Parameters

    source_path:   The file to compress - String - required
    out_path:   The .xz file to write - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; csv write "tmp/tuto_ops/logs/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; csv write "tmp/tuto_ops/logs/old/day0.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}]"; compress xz "tmp/tuto_ops/logs/day1.csv" "tmp/tuto_ops/day1.csv.xz"; -> "[res]" (compress xz "tmp/tuto_ops/logs/day1.csv" "tmp/tuto_ops/day1.csv.xz" "{\"level\": 9, \"overwrite\": true}"); file delete "tmp/tuto_ops"; [res]
mentdb
{"out_path": "tmp/tuto_ops/day1.csv.xz", "bytes_in": 113, "bytes_out": 144, "level": 9}

compress unxz <xz_path> <out_path>


Description

    Decompress an xz file (several concatenated streams are read one after the other). Returns {out_path, bytes}. Limit: 1 GB written

Parameters

    xz_path:   The .xz file - String - required
    out_path:   The file to write - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; csv write "tmp/tuto_ops/logs/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; csv write "tmp/tuto_ops/logs/old/day0.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}]"; compress xz "tmp/tuto_ops/logs/day1.csv" "tmp/tuto_ops/day1.csv.xz"; -> "[res]" (compress unxz "tmp/tuto_ops/day1.csv.xz" "tmp/tuto_ops/copy.csv"); file delete "tmp/tuto_ops"; [res]
mentdb
{"out_path": "tmp/tuto_ops/copy.csv", "bytes": 113}

compress unxz <xz_path> <out_path> <json_params>


Description

    Decompress an xz file with parameters: max_bytes (1073741824, up to 64 GB), overwrite (false)

Parameters

    xz_path:   The .xz file - String - required
    out_path:   The file to write - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; csv write "tmp/tuto_ops/logs/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; csv write "tmp/tuto_ops/logs/old/day0.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}]"; compress xz "tmp/tuto_ops/logs/day1.csv" "tmp/tuto_ops/day1.csv.xz"; try {-> "[res]" (compress unxz "tmp/tuto_ops/day1.csv.xz" "tmp/tuto_ops/copy.csv" "{\"max_bytes\": 50}");} {-> "[res]" [err];} "[err]"; file delete "tmp/tuto_ops"; [res]
mentdb
line 1 >>> -> [res] "compress unxz \"tmp/tuto_ops/day1.csv.xz\" \"tmp/tuto_ops/copy.csv\" \... line 1 >>> compress unxz tmp/tuto_ops/day1.csv.xz tmp/tuto_ops/copy.csv "{\"max_bytes\": 50... [[[ Sorry, an error appears (the expanded content is over 50 bytes (see max_bytes)). ]]]

compress tarXz <source_path> <out_path>


Description

    Archive a file or a folder into a .tar.xz (POSIX tar, UTF-8 names, long names and big files supported): entries are rooted at the name of the folder, sorted, symbolic links skipped. Returns {out_path, files, folders, bytes_in, bytes_out, skipped_links, level}

Parameters

    source_path:   The file or folder - String - required
    out_path:   The .tar.xz file to write (not inside the folder) - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; csv write "tmp/tuto_ops/logs/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; csv write "tmp/tuto_ops/logs/old/day0.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}]"; -> "[res]" (compress tarXz "tmp/tuto_ops/logs" "tmp/tuto_ops/logs.tar.xz"); file delete "tmp/tuto_ops"; [res]
mentdb
{"out_path": "tmp/tuto_ops/logs.tar.xz", "files": 2, "folders": 2, "bytes_in": 160, "bytes_out": 384, "skipped_links": 0, "level": 6}

compress tarXz <source_path> <out_path> <json_params>


Description

    Archive into a .tar.xz with parameters: level (0 to 9, 6), overwrite (false), max_files (100000)

Parameters

    source_path:   The file or folder - String - required
    out_path:   The .tar.xz file to write - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; csv write "tmp/tuto_ops/logs/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; csv write "tmp/tuto_ops/logs/old/day0.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}]"; -> "[res]" (compress tarXz "tmp/tuto_ops/logs" "tmp/tuto_ops/logs.tar.xz" "{\"level\": 1}"); file delete "tmp/tuto_ops"; [res]
mentdb
{"out_path": "tmp/tuto_ops/logs.tar.xz", "files": 2, "folders": 2, "bytes_in": 160, "bytes_out": 392, "skipped_links": 0, "level": 1}
Used in use cases (1 recipe)

    Files & archives manager › Archive a month of logs into a .tar.xz or a .7z and prove that it can be restored
Often used with

    and  ·  compress 7z  ·  compress un7z  ·  compress untarXz  ·  csv write  ·  file delete  ·  file exist  ·  file mkdir

compress untarXz <archive_path> <out_dir>


Description

    Extract a .tar.xz into a folder (created if needed). Returns {out_dir, files, folders, bytes, skipped_links}. Unsafe entries stop the call and remove what was written

Parameters

    archive_path:   The .tar.xz file - String - required
    out_dir:   The target folder - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; csv write "tmp/tuto_ops/logs/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; csv write "tmp/tuto_ops/logs/old/day0.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}]"; compress tarXz "tmp/tuto_ops/logs" "tmp/tuto_ops/logs.tar.xz"; -> "[res]" (compress untarXz "tmp/tuto_ops/logs.tar.xz" "tmp/tuto_ops/restored"); file delete "tmp/tuto_ops"; [res]
mentdb
{"out_dir": "tmp/tuto_ops/restored", "files": 2, "folders": 2, "bytes": 160, "skipped_links": 0}

compress untarXz <archive_path> <out_dir> <json_params>


Description

    Extract a .tar.xz with parameters: max_entries (10000), max_bytes (1073741824), overwrite (false: an existing file stops the call)

Parameters

    archive_path:   The .tar.xz file - String - required
    out_dir:   The target folder - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; csv write "tmp/tuto_ops/logs/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; csv write "tmp/tuto_ops/logs/old/day0.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}]"; compress tarXz "tmp/tuto_ops/logs" "tmp/tuto_ops/logs.tar.xz"; compress untarXz "tmp/tuto_ops/logs.tar.xz" "tmp/tuto_ops/restored"; -> "[res]" (compress untarXz "tmp/tuto_ops/logs.tar.xz" "tmp/tuto_ops/restored" "{\"overwrite\": true}"); file delete "tmp/tuto_ops"; [res]
mentdb
{"out_dir": "tmp/tuto_ops/restored", "files": 2, "folders": 2, "bytes": 160, "skipped_links": 0}
Complete: too many entries for the limit
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; csv write "tmp/tuto_ops/logs/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; csv write "tmp/tuto_ops/logs/old/day0.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}]"; compress tarXz "tmp/tuto_ops/logs" "tmp/tuto_ops/logs.tar.xz"; try {-> "[res]" (compress untarXz "tmp/tuto_ops/logs.tar.xz" "tmp/tuto_ops/restored" "{\"max_entries\": 2}");} {-> "[res]" [err];} "[err]"; file delete "tmp/tuto_ops"; [res]
mentdb
line 1 >>> -> [res] "compress untarXz \"tmp/tuto_ops/logs.tar.xz\" \"tmp/tuto_ops/restored\... line 1 >>> compress untarXz tmp/tuto_ops/logs.tar.xz tmp/tuto_ops/restored "{\"max_entries\... [[[ Sorry, an error appears (the archive has more than 2 entries (see max_entries)). ]]]
Used in use cases (1 recipe)

    Files & archives manager › Archive a month of logs into a .tar.xz or a .7z and prove that it can be restored
Often used with

    and  ·  compress 7z  ·  compress tarXz  ·  compress un7z  ·  csv write  ·  file delete  ·  file exist  ·  file mkdir

compress 7z <source_path> <out_path>


Description

    Archive a file or a folder into a .7z (LZMA2, solid): entries rooted at the name of the folder, sorted, symbolic links skipped. Returns {out_path, files, folders, bytes_in, bytes_out, skipped_links, method, encrypted}. An existing out_path is an error

Parameters

    source_path:   The file or folder - String - required
    out_path:   The .7z file to write (not inside the folder) - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; csv write "tmp/tuto_ops/logs/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; csv write "tmp/tuto_ops/logs/old/day0.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}]"; -> "[res]" (compress 7z "tmp/tuto_ops/logs" "tmp/tuto_ops/logs.7z"); file delete "tmp/tuto_ops"; [res]
mentdb
{"out_path": "tmp/tuto_ops/logs.7z", "files": 2, "folders": 2, "bytes_in": 160, "bytes_out": 397, "skipped_links": 0, "method": "lzma2", "encrypted": false}

compress 7z <source_path> <out_path> <json_params>


Description

    Archive into a .7z with parameters: method (lzma2, lzma, deflate, bzip2, copy), password (AES-256 encryption of the content, the names stay readable), overwrite (false), max_files (100000)

Parameters

    source_path:   The file or folder - String - required
    out_path:   The .7z file to write - String - required
    json_params:   The parameters - String - required
admin
csv write "tmp/tuto_ops7/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; compress 7z "tmp/tuto_ops7/day1.csv" "tmp/tuto_ops7/day1.7z" "{\"method\": \"deflate\", \"overwrite\": true}"
mentdb
{"out_path": "tmp/tuto_ops7/day1.7z", "files": 1, "folders": 0, "bytes_in": 113, "bytes_out": 195, "skipped_links": 0, "method": "deflate", "encrypted": false}
Fixed result from a real run with the secret MENTDB_ARCHIVE_PASSWORD set on the server: an encrypted archive
admin
compress 7z "tmp/tuto_ops7/day1.csv" "tmp/tuto_ops7/day1_enc.7z" "{\"password\": \"mentdb_archive_password\", \"overwrite\": true}"
mentdb
{"out_path": "tmp/tuto_ops7/day1_enc.7z", "files": 1, "folders": 0, "bytes_in": 113, "bytes_out": 251, "skipped_links": 0, "method": "lzma2", "encrypted": true}
Used in use cases (1 recipe)

    Files & archives manager › Archive a month of logs into a .tar.xz or a .7z and prove that it can be restored
Often used with

    and  ·  compress tarXz  ·  compress un7z  ·  compress untarXz  ·  csv write  ·  file delete  ·  file exist  ·  file mkdir

compress un7z <archive_path> <out_dir>


Description

    Extract a .7z into a folder (created if needed). Returns {out_dir, files, folders, bytes, skipped_links}. Unsafe entries stop the call and remove what was written

Parameters

    archive_path:   The .7z file - String - required
    out_dir:   The target folder - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; csv write "tmp/tuto_ops/logs/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; csv write "tmp/tuto_ops/logs/old/day0.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}]"; compress 7z "tmp/tuto_ops/logs" "tmp/tuto_ops/logs.7z"; -> "[res]" (compress un7z "tmp/tuto_ops/logs.7z" "tmp/tuto_ops/restored"); file delete "tmp/tuto_ops"; [res]
mentdb
{"out_dir": "tmp/tuto_ops/restored", "files": 2, "folders": 2, "bytes": 160, "skipped_links": 0}

compress un7z <archive_path> <out_dir> <json_params>


Description

    Extract a .7z with parameters: password (an encrypted archive), max_entries (10000), max_bytes (1073741824), overwrite (false: an existing file stops the call; true: the files are replaced only when the whole extraction succeeds)

Parameters

    archive_path:   The .7z file - String - required
    out_dir:   The target folder - String - required
    json_params:   The parameters - String - required
admin
csv write "tmp/tuto_ops7/day1.csv" "[{\"time\": \"2026-11-10 08:00\", \"level\": \"INFO\", \"message\": \"start\"}, {\"time\": \"2026-11-10 08:05\", \"level\": \"WARN\", \"message\": \"disk 81 %\"}, {\"time\": \"2026-11-10 08:09\", \"level\": \"INFO\", \"message\": \"backup done\"}]"; compress 7z "tmp/tuto_ops7/day1.csv" "tmp/tuto_ops7/day1.7z" "{\"overwrite\": true}"; compress un7z "tmp/tuto_ops7/day1.7z" "tmp/tuto_ops7/out" "{\"overwrite\": true}"
mentdb
{"out_dir": "tmp/tuto_ops7/out", "files": 1, "folders": 0, "bytes": 113, "skipped_links": 0}
An encrypted archive without password
admin
compress un7z "tmp/tuto_ops7/day1_enc.7z" "tmp/tuto_ops7/out2"
mentdb
Sorry, an error appears (the 7z archive is encrypted: give the parameter 'password').
Fixed result from a real run with the secret MENTDB_ARCHIVE_PASSWORD set on the server
admin
compress un7z "tmp/tuto_ops7/day1_enc.7z" "tmp/tuto_ops7/out2" "{\"password\": \"mentdb_archive_password\", \"overwrite\": true}"
mentdb
{"out_dir": "tmp/tuto_ops7/out2", "files": 1, "folders": 0, "bytes": 113, "skipped_links": 0}
Used in use cases (1 recipe)

    Files & archives manager › Archive a month of logs into a .tar.xz or a .7z and prove that it can be restored
Often used with

    and  ·  compress 7z  ·  compress tarXz  ·  compress untarXz  ·  csv write  ·  file delete  ·  file exist  ·  file mkdir