Created
July 2, 2023 14:13
-
-
Save intergalacticmammoth/65386bfe180b0bc104210567aba785be to your computer and use it in GitHub Desktop.
Simple script for backing up your notes
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 | |
# Path to your notes | |
SOURCE_DIR="$HOME/Documents/notes/" | |
# Path to save backups | |
DEST_DIR="$HOME/Nextcloud/Backups/note-backups" | |
# The actual filename to use for current backup e.g. notes-2023-07-03.tar.gz | |
BACKUP_FILE="${DEST_DIR}/notes-$(date +'%Y-%m-%d').tar.gz" | |
# Compress all the files in SOURCE_DIR and save them to BACKUP_FILE | |
tar -czf "${BACKUP_FILE}" "${SOURCE_DIR}" | |
echo "Finished running $0." | |
echo "If all went smoothly, backup should be at ${BACKUP_FILE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script accompanying the post Simple automated backup for markdown notes on aristot.io.