bin/archive-to-sync
2023-11-08 09:50:06 -06:00

16 lines
355 B
Bash
Executable File

#!/usr/bin/env bash
SYNC_DIR="${HOME}/sync"
archive_maybe=(
"${HOME}/sync/org"
"${HOME}/sync/org-roam"
"${HOME}/sync/sites"
)
for dir in "${archive_maybe[@]}"; do
if [ "$(find "$dir" -type f -mtime -1 | wc -l)" -gt 0 ]; then
create-archive "$dir"
mv -v "$dir-$(date '+%Y%m%d').tar.gz" "${SYNC_DIR}/archived/"
fi
done