Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ mega_email=""
mega_pass=""
mega_path="/Root/backups" # /Root/ should always be here.

# Upload to Google Drive if you have installed and authorized the gdrive CLI.
gdrive_enable="no"
gdrive_dir_id="" # Used for uploading to a specific directory


# Full MySQL dump (All Databases)
mysql_backup="no"
mysql_user=""
Expand Down Expand Up @@ -436,6 +441,28 @@ then
fi
fi

# Upload archive file to Google Drive
if [ $gdrive_enable = "yes" ]
then
if [ `which gdrive` ]
then
echo -e "\n ${color}--- $date_now Uploading backup archive to Google Drive \n${nc}"
echo "$date_now Uploading backup archive to Google Drive" >> $log_file
if [ $gdrive_dir_id != "" ]
then
gdrive upload --parent $gdrive_dir_id $backup_path/$final_archive
else
gdrive upload $backup_path/$final_archive
fi
echo "$date_now Google Drive Upload Done." | tee -a $log_file
else
echo -e " ${color_fail}--- $date_now You have been enabled Google Drive upload. ${nc}"
echo -e " ${color_fail}--- $date_now You need to install gdrive. For more information see https://github.com/prasmussen/gdrive ${nc}"
echo -e " ${color_fail}--- $date_now Google Drive upload failed. ${nc}"
echo "$date_now Uploading to Google Drive failed. Install 'gdrive'. For more information see https://github.com/prasmussen/gdrive" >> $log_file
fi
fi

# Send a simple email notification
if [ $send_email = "yes" ]
then
Expand Down