bin/archive-to-megasync

16 lines
355 B
Plaintext
Raw Normal View History

2023-09-08 14:33:56 +02:00
#!/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