diff --git a/nas-gdrive-backup.sh b/nas-gdrive-backup.sh index d796fa1..b429cc2 100644 --- a/nas-gdrive-backup.sh +++ b/nas-gdrive-backup.sh @@ -4,6 +4,9 @@ # For each folder on BACKUP_SOURCE, it gets the sha256 checksum of it, checks the checksum against the previous backup, and if it has changed, it creates a 7zip archive of the folder with encryption. # It then uploads the archive to Google Drive using rclone. +# Install: curl -sSL https://git.ivanch.me/ivanch/server-scripts/raw/branch/main/nas-gdrive-backup.sh | bash -s -- --install +# Run manually: /usr/local/bin/nas-gdrive-backup.sh + # Configuration BACKUP_SOURCE="/export/Backup" META_DIR="/export/Backup/.gdrive" @@ -14,13 +17,6 @@ GDRIVE_PATH="/NAS-Backups" ARCHIVE_NAME="backup.7z" LOG_FILE="/var/log/nas-gdrive-backup.log" -# Check for install flag -# Usage: curl -sSL https://git.ivanch.me/ivanch/server-scripts/raw/branch/main/nas-gdrive-backup.sh | bash -s -- --install -if [[ "$1" == "--install" ]]; then - install_script - exit 0 -fi - # Function for logging log() { echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE" @@ -265,5 +261,11 @@ install_script() { exit 0 } +# Check for install flag +if [[ "$1" == "--install" ]]; then + install_script + exit 0 +fi + main "$@" exit 0 \ No newline at end of file