#!/bin/bash set -e increment=20 first=$1 first_index="$(printf '%04d' $first)" last_index="$(printf '%04d' $(($first + $increment - 1)))" folder="threads/$first_index-$last_index" archive="threads-compressed/$first_index-$last_index.tar.xz" tar -C "$folder" -cJvf "$archive" . git add "$folder" "$archive" 'index.tsv' git commit -m 'feat(batch): added next batch' git push