reorder again
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 22s
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 22s
This commit is contained in:
@@ -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.
|
# 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.
|
# 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
|
# Configuration
|
||||||
BACKUP_SOURCE="/export/Backup"
|
BACKUP_SOURCE="/export/Backup"
|
||||||
META_DIR="/export/Backup/.gdrive"
|
META_DIR="/export/Backup/.gdrive"
|
||||||
@@ -14,13 +17,6 @@ GDRIVE_PATH="/NAS-Backups"
|
|||||||
ARCHIVE_NAME="backup.7z"
|
ARCHIVE_NAME="backup.7z"
|
||||||
LOG_FILE="/var/log/nas-gdrive-backup.log"
|
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
|
# Function for logging
|
||||||
log() {
|
log() {
|
||||||
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE"
|
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE"
|
||||||
@@ -265,5 +261,11 @@ install_script() {
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check for install flag
|
||||||
|
if [[ "$1" == "--install" ]]; then
|
||||||
|
install_script
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
exit 0
|
exit 0
|
Reference in New Issue
Block a user