echo6-docs/vault/runbooks/ia-download-mirror.md
echo6-autocommit eb7eade7fa auto: docs sync 2026-06-18T18:00:10+00:00
Files changed: .gitignore CLAUDE.md credentials engine/.embcache.json engine/changelog.md engine/config.yaml engine/lib/__pycache__/agent.cpython-312.pyc engine/lib/agent.py engine/lib/lint.py engine/lint-report.md engine/sweep-full.log engine/sweep.sh vault/.obsidian/graph.json vault/.obsidian/workspace.json vault/INDEX.md vault/archive/projects/mmud/last-ember-chronicle.html vault/archive/projects/mmud/last-ember-howto.html vault/archive/projects/mmud/last-ember.html vault/archive/projects/mmud/mmud-phase5-prompt.md vault/archive/projects/mmud/mmud-phase6-prompt.md vault/archive/projects/mmud/mmud-prompts/mmud-prompts/01-update-planned.md vault/archive/projects/mmud/mmud-prompts/mmud-prompts/02-npc-nodes.md vault/archive/projects/mmud/mmud-prompts/mmud-prompts/03-darkcragg.md vault/archive/projects/mmud/mmud-prompts/mmud-prompts/04-dcrg-node.md vault/archive/projects/mmud/mmud-prompts/mmud-prompts/05-phase5.md vault/archive/projects/mmud/mmud-prompts/mmud-prompts/06-phase6.md vault/archive/projects/mmud/mmud-prompts/mmud-prompts/README.md vault/archive/projects/mmud/mmud-prompts/mmud-prompts/mmud-project.md vault/docs/hardware/environment.md vault/docs/hardware/ip-allocation.md vault/docs/matrix/archivist.md vault/docs/matrix/matrix_host.md vault/docs/matrix/mautrix_signal.md vault/docs/matrix/synapse.md vault/docs/matrix/synapse_retention_discovery.md vault/docs/navi/cc-rules.md vault/docs/navi/deployment.md vault/docs/navi/themes.md vault/docs/services/ots-setup.md vault/docs/services/services.md vault/docs/services/usenet.md vault/docs/software/authentik.md vault/docs/software/caddy.md vault/docs/software/dns.md vault/docs/software/geo-tools.md vault/docs/software/recon.md vault/docs/software/searxng.md vault/glossary.md vault/notes/echo6-landing-page-data-export.md vault/notes/ia-download-queue.md vault/plans/vaultwarden-plan.md vault/projects/advbbs-project.md vault/projects/argus.md vault/projects/deploy-livesync.md vault/projects/matrix-synapse-deployment.md vault/projects/meshtastic-headscale-runbook.md vault/projects/mmud-project.md vault/runbooks/add-peertube-channel.md vault/runbooks/authentik-access-groups.md vault/runbooks/authentik-create-invitation.md vault/runbooks/authentik-oidc-application.md vault/runbooks/authentik-upgrade.md vault/runbooks/ct-runbook.md vault/runbooks/edge2-access-reference.md vault/runbooks/expose-service-contabo.md vault/runbooks/expose-service-edge2.md vault/runbooks/expose-service-home.md vault/runbooks/headscale-onboard-node.md vault/runbooks/ia-cli-reference.md vault/runbooks/ia-download-mirror.md vault/runbooks/idahomesh-bridge-setup.md vault/runbooks/idahomesh-vpn-device-setup.md vault/runbooks/lxc-service-migration.md vault/runbooks/mailcow-create-mailbox.md vault/runbooks/meshmonitor-password-reset.md vault/runbooks/meshtastic-sidecar-node.md vault/runbooks/meshtasticd-sim-nodes-runbook.md vault/runbooks/nordvpn-lxc.md vault/runbooks/peertube-remote-runner.md vault/runbooks/pg-backup.md vault/runbooks/pi-nas-omv-runbook.md vault/runbooks/pipeline-patterns.md vault/runbooks/proxmox-create-ubuntu-vm.md vault/runbooks/proxmox-onboard-node.md vault/runbooks/recon-operations.md vault/runbooks/recon-service-integration.md vault/runbooks/syncthing-add-node.md vault/session-resume/SESSION-HANDOFF-meshai-test.md
2026-06-18 18:00:10 +00:00

11 KiB

title type tags aliases related updated
Download & Mirror from Internet Archive runbook
storage
ia-cli-reference
ia-download-queue
pipeline-patterns
syncthing-add-node
idahomesh-vpn-device-setup
2026-06-18

Download & Mirror from Internet Archive

Procedures for downloading items, filtering by format/pattern, bulk downloading from collections, and mirroring entire collections via the ia CLI on pi-nas.


Prerequisites

  • ia CLI installed on pi-nas (192.168.1.245) — v5.7.2
  • Authenticated if downloading restricted items: ia configure
  • Sufficient storage on pi-nas (check with df -h)
  • Reference: ia-cli-reference.md for search/query syntax

1. Download a Single Item

An "item" is a logical unit on archive.org identified by its identifier (visible in the URL: archive.org/details/<identifier>).

# Download all files in an item to ./<identifier>/
ia download <identifier>

# Example
ia download prelinger_films

The default creates a directory named after the identifier containing all files (originals + derivatives).

Gate

Verify the download directory exists and has files:

ls -la <identifier>/

2. Filtered Downloads

By glob pattern

Download only files matching a shell glob pattern.

# Only PDFs
ia download <identifier> --glob="*.pdf"

# Only MP4 video files
ia download <identifier> --glob="*.mp4"

# Multiple patterns (pipe-separated)
ia download <identifier> --glob="*.pdf|*.epub"

With exclusions

Exclude patterns require --glob to also be set.

# All MP4s except low-quality variants
ia download <identifier> --glob="*.mp4" --exclude="*512kb*"

# All files except metadata/review XMLs
ia download <identifier> --glob="*" --exclude="*_meta.xml|*_reviews.xml|*_files.xml"

# Multiple exclusions
ia download <identifier> --glob="*.mp4" --exclude="*512kb*|*_thumb*"

By format name

Download files of a specific archive.org format (as shown by ia metadata --formats).

# Check available formats first
ia metadata <identifier> --formats

# Download only a specific format
ia download <identifier> --format="512Kb MPEG4"
ia download <identifier> --format="PDF"
ia download <identifier> --format="EPUB"

Note: --format is incompatible with --glob and --exclude. Use one approach or the other.

On-the-fly formats

Some formats (EPUB, MOBI, DAISY, MARCXML) are generated on demand.

ia download <identifier> --on-the-fly --format="EPUB"

3. Download Options

Control output location

# Download to a specific directory
ia download <identifier> --destdir=/mnt/archive/downloads/

# Flatten directory structure (no subdirectory per item)
ia download <identifier> --no-directories

Resume interrupted downloads

# Resume — skips files that already exist and match checksum
ia download <identifier> --checksum

# Checksum mode compares MD5 hashes — safe to re-run

Preserve timestamps

# Keep original timestamps from archive.org
ia download <identifier> --no-change-timestamp

Dry run

# See what would be downloaded without actually downloading
ia download <identifier> --dry-run

4. Bulk Download from Search Results

Pipe search results directly into download. This is the primary method for downloading multiple items.

Basic pattern

# Search → itemlist → download
ia search 'collection:prelinger mediatype:movies' --itemlist | \
  ia download --itemlist -

# The - tells ia download to read identifiers from stdin

With filters

# Download only PDFs from all items in a collection
ia search 'collection:arrl_qst' --itemlist | \
  ia download --itemlist - --glob="*.pdf"

# Download only MP3s from an audio collection
ia search 'collection:librivoxaudio' --itemlist | \
  ia download --itemlist - --glob="*.mp3"

With destination directory

# Download to a specific location
ia search 'collection:prelinger' --itemlist | \
  ia download --itemlist - --destdir=/mnt/archive/prelinger/

Save itemlist for reuse

When a search is large, save the itemlist first so you can resume without re-searching.

# Step 1: Save itemlist
ia search 'collection:prelinger mediatype:movies' --itemlist > prelinger-items.txt

# Step 2: Check count
wc -l prelinger-items.txt

# Step 3: Download from file
ia download --itemlist prelinger-items.txt --glob="*.mp4"

# Step 4: Resume if interrupted (just re-run with --checksum)
ia download --itemlist prelinger-items.txt --glob="*.mp4" --checksum

5. Bulk Download with GNU Parallel

For faster bulk downloads, use GNU Parallel for concurrent item downloads.

# Install parallel if not present
sudo apt install -y parallel

# Download 5 items concurrently
ia search 'collection:prelinger' --itemlist | \
  parallel -j5 'ia download {} --glob="*.mp4"'

# With destination directory
ia search 'collection:prelinger' --itemlist | \
  parallel -j5 'ia download {} --glob="*.mp4" --destdir=/mnt/archive/prelinger/'

# From saved itemlist
parallel -j5 'ia download {} --glob="*.pdf"' < items.txt

Caution: Be respectful of archive.org bandwidth. 3-5 concurrent downloads is reasonable. Higher parallelism may trigger rate limiting.


6. Mirror an Entire Collection

Mirroring means downloading everything and being able to re-run to pick up new additions.

Initial mirror

# Step 1: Create working directory
mkdir -p /mnt/archive/<collection-name>
cd /mnt/archive/<collection-name>

# Step 2: Generate itemlist
ia search 'collection:<collection-name>' --itemlist > itemlist.txt
echo "Found $(wc -l < itemlist.txt) items"

# Step 3: Download all items (adjust --glob as needed)
ia download --itemlist itemlist.txt --destdir=/mnt/archive/<collection-name>/

# Or with format filter
ia download --itemlist itemlist.txt --glob="*.pdf" --destdir=/mnt/archive/<collection-name>/

Update an existing mirror

Re-run the same commands. Use --checksum to skip already-downloaded files.

cd /mnt/archive/<collection-name>

# Refresh itemlist (new items since last run)
ia search 'collection:<collection-name>' --itemlist > itemlist-new.txt

# Download only new/changed files
ia download --itemlist itemlist-new.txt --checksum --destdir=/mnt/archive/<collection-name>/

Mirror with a script

For recurring mirrors, create a simple script:

#!/bin/bash
# mirror-collection.sh <collection-name> [glob-pattern]
COLLECTION="$1"
GLOB="${2:-*}"
DEST="/mnt/archive/$COLLECTION"

mkdir -p "$DEST"

echo "Refreshing itemlist for $COLLECTION..."
ia search "collection:$COLLECTION" --itemlist > "$DEST/itemlist.txt"
COUNT=$(wc -l < "$DEST/itemlist.txt")
echo "Found $COUNT items"

echo "Downloading (glob: $GLOB)..."
ia download --itemlist "$DEST/itemlist.txt" --glob="$GLOB" --checksum --destdir="$DEST/"

echo "Mirror complete: $DEST"

Usage:

chmod +x mirror-collection.sh
./mirror-collection.sh arrl_qst "*.pdf"
./mirror-collection.sh prelinger "*.mp4"

7. Practical Patterns

Download all PDFs from a collection

ia search 'collection:arrl_qst' --itemlist | \
  ia download --itemlist - --glob="*.pdf" --destdir=/mnt/archive/arrl-qst/

Download specific media types from a collection

# High-quality video only
ia search 'collection:prelinger' --itemlist | \
  ia download --itemlist - --format="MPEG4" --destdir=/mnt/archive/prelinger-video/

# Audio in MP3 format
ia search 'collection:librivoxaudio creator:"Mark Twain"' --itemlist | \
  ia download --itemlist - --glob="*64kb*.mp3" --destdir=/mnt/archive/twain-audio/

Download items matching a date range

ia search 'collection:arrl_qst date:[1950-01-01 TO 1959-12-31]' --itemlist | \
  ia download --itemlist - --glob="*.pdf" --destdir=/mnt/archive/arrl-1950s/

Download a single specific file from an item

# List files first
ia list <identifier>

# Download just one file
ia download <identifier> specific-file.pdf

Download and preserve directory structure

# Default behavior — each item gets its own subdirectory
ia download --itemlist items.txt --destdir=/mnt/archive/output/
# Result: /mnt/archive/output/<identifier1>/files...
#         /mnt/archive/output/<identifier2>/files...

Pipe a single file to stdout

# Stream a file without saving to disk
ia download <identifier> specific-file.pdf --stdout | less
ia download <identifier> data.json --stdout | jq .

8. Storage Planning

Before large downloads, estimate storage requirements.

# Count items in collection
ia search 'collection:<name>' --num-found

# Check a sample item's size
ia metadata <sample-identifier> | jq '[.files[].size | tonumber] | add / 1048576 | floor'
# Output in MB

# Check available storage on pi-nas
df -h /mnt/

Rule of thumb

  • Text collections (PDFs, EPUBs): ~10-100 MB per item
  • Audio collections: ~100 MB - 1 GB per item
  • Video collections: ~1-10 GB per item
  • Software archives: highly variable

Troubleshooting

Download hangs or stalls

# Kill and resume with checksum verification
# Ctrl+C to stop, then re-run with --checksum
ia download --itemlist items.txt --glob="*.pdf" --checksum

"Item not found" errors in bulk download

Some items in a collection may be restricted or taken down. These will fail individually but the batch continues. Check errors in output.

Disk full during bulk download

# Check what's using space
du -sh /mnt/archive/*/ | sort -rh | head -20

# Resume after freeing space — checksum mode skips completed files
ia download --itemlist items.txt --checksum

Rate limiting / 429 errors

Archive.org may throttle aggressive downloads.

  • Reduce parallel jobs (if using GNU Parallel)
  • Add delays between items: parallel -j2 --delay 5 'ia download {}' < items.txt
  • Wait and retry later

Corrupt downloads

# Re-download with checksum verification — replaces corrupt files
ia download <identifier> --checksum

Permission denied on destination

# Ensure the download user owns the target directory
sudo chown -R $(whoami):$(whoami) /mnt/archive/

Checklist: Collection Mirror

[ ] Identify collection identifier on archive.org
[ ] Check available storage (df -h)
[ ] Estimate collection size (--num-found + sample item size)
[ ] Generate itemlist (ia search --itemlist > itemlist.txt)
[ ] Review itemlist count (wc -l itemlist.txt)
[ ] Start download with appropriate filters (--glob, --format)
[ ] Verify downloaded files exist and are non-zero
[ ] If interrupted, resume with --checksum
[ ] Record collection details in project notes

Last updated: 2026-02-14