Skip to content

Instantly share code, notes, and snippets.

@dmgolembiowski
Created January 16, 2024 21:23
Show Gist options
  • Save dmgolembiowski/bdf5b26d8967fd4937ff353cceae6ebc to your computer and use it in GitHub Desktop.
Save dmgolembiowski/bdf5b26d8967fd4937ff353cceae6ebc to your computer and use it in GitHub Desktop.
Checkpoint script for when you do not want Git history
#!/bin/bash
cwd=$(dirname $(readlink -f $0))
checkpoint_dir="$cwd/backup"
mkdir -p "$checkpoint_dir"
infix=$(date '+%F_%T')
output="$checkpoint_dir/checkpoint-$infix.tar"
tar \
--exclude='dist' \
--exclude='__pycache__' \
--exclude='node_modules' \
--exclude='vendor' \
--exclude='checkpoint-*' \
--exclude='backup/*' \
--exclude='.git' \
--exclude='target' \
-zcvf \
$output .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment