Created
May 18, 2020 12:18
-
-
Save h1dd3nsn1p3r/fef32857b3f33d898062267fea9bbc1b to your computer and use it in GitHub Desktop.
rClone script to backup files to Back Blaze B2. You need to have rclone installed in your server (https://rclone.org/install/). After installing an rclone configure Google Drive (https://rclone.org/drive/). You can call this script from Linux crontab
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 | |
############################################################################## | |
# An rclone backup script by Anuj Subedi ([email protected]). | |
# | |
# Copyright (C) 2020 Anuj Subedi <[email protected]> | |
# | |
# This script is licensed under the terms of the MIT license. | |
# https://opensource.org/licenses/MIT | |
# | |
# Runs the 'rclone sync' command. Designed to be used as a cron job. | |
# | |
# 1) Backup Source | |
# In our case backup source is dir /home/backup/ | |
# | |
# 2) Backup Destination | |
# This particulat script sync datas to BackBlaze B2 cloud | |
# | |
# 3) Logs: | |
# Logs can be found in this dir /home/sysadmin/backup/logs/ | |
# | |
############################################################################## | |
# rclone source to sync | |
SRC_DIR='/home/backup' | |
# rclone remote storage | |
REMOTE_PATH='b2:cp-dirname' | |
# rclone sync log path | |
RCLONE_LOG='/home/sysadmin/backup/logs/rclone-sync-backblazeb2-daily.log' | |
################################################### | |
## | |
## Let's run the sync command here | |
## | |
################################################### | |
/usr/bin/rclone sync $SRC_DIR $REMOTE_PATH --log-file=$RCLONE_LOG --log-level INFO | |
# Once job is done. Let's exit the script | |
exit | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment