Created
August 7, 2020 03:08
-
-
Save joshuaspence/03219cf63ce5395d2e0c00a54b969007 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
readonly SCRIPT_DIR="${HOME}/workspace/personal/pocketsmith_backup" | |
readonly OUTPUT_DIR="${HOME}/Desktop/budget" | |
readonly BACKUP_DIR="${OUTPUT_DIR}.bak" | |
cp --recursive "${OUTPUT_DIR}" "${BACKUP_DIR}" | |
$SCRIPT_DIR/categories.sh > $OUTPUT_DIR/categories-all.txt | |
$SCRIPT_DIR/budgets.sh > $OUTPUT_DIR/categories-budgeted.txt | |
comm -23 $OUTPUT_DIR/categories-all.txt <(cat $OUTPUT_DIR/categories-{budgeted,parent,todo}.txt | sort) > $OUTPUT_DIR/categories-unbudgeted.txt | |
diff --unified --recursive "${BACKUP_DIR}" "${OUTPUT_DIR}" || true | |
rm --recursive --force "${BACKUP_DIR}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment