ValidateGZ

Script: validategz.sh Type: Bash script (no Java class)

Scans one or more files or directories for *.gz files and reports any that are empty (0 bytes) or fail a gzip integrity test (corrupt).

Basic Usage

validategz.sh <dir-or-file> [more dirs/files ...] [-jN]

Directories are scanned recursively for *.gz files; individual files are checked directly. Each bad file is printed as one line (EMPTY<tab>path or CORRUPT<tab>path), followed by a summary count on stderr. Exit status is nonzero if any bad file was found, so it can gate a pipeline.

Parameters

Arguments

<dir-or-file>
One or more positional paths — files or directories — to scan. At least one is required. Directories are scanned recursively for *.gz files.
-jN
Run N gzip integrity tests in parallel. Default is 4.

Examples

Scan a Directory

validategz.sh /data/genomes

Recursively checks every *.gz file under /data/genomes for empty or corrupt files.

Scan Specific Files with More Parallelism

validategz.sh file1.fna.gz file2.gff.gz -j8

Checks two specific files, running up to 8 gzip tests in parallel.

Gate a Pipeline

validategz.sh /data/genomes && echo "all gz files clean"

Since the exit status is nonzero if any bad file is found, this can be used directly to gate a downstream pipeline step.

Support

For questions and support: