Automate uploading to your cloud storage. This uses "Mergerfs" for compatibility with Sonarr, Radarr, and streaming to Plex/Emby. Automate uploading from a local or remote machine running Ubuntu 18.04 or Debian 9/10.
This guide will help you get started and is by no means the best way of doing things... this is what works for me. I created this repo for my own reference.
- Setup SBCloud scripts
- Setup Rclone config
- Using cron to schedule Rclone scripts
I am not responsible for anything that could go wrong. I am not responsible for any data loss that could potentialy happen. You agree to use these scripts at your own risk.
- We will be working from the main directory "/mnt"
- Script has only been tested on Debian 9/10 and Ubuntu 18.04
Install/Update script
sudo apt update && sudo apt install curl git -y && curl -fsSL http://get.sbcloud.tk | sudo bash
Install DockSTARTer
Reboot afterwards
$ bash -c "$(curl -fsSL https://get.dockstarter.com)"
$ sudo reboot
Install/Update script
Reboot afterwards
sudo apt update && sudo apt install curl git -y && curl -fsSL http://getfull.sbcloud.tk | sudo bash
The install script should set your permissions but if not you can run the following manually
DockSTARTer also helps set permissions, check the configuration
$ sudo chmod -R +x /mnt && sudo chown -R $USER:$USER /mnt
If the script fails to modify fuse.conf you can do this manually
You must edit /etc/fuse.conf to use option "allow_other" by uncommenting "user_allow_other"
$ sudo nano /etc/fuse.conf
The install script should set your permissions for your rclone.conf but if not run the following. If you don't set permissions rclone will complain that it is needs sudo/root to run, which we do not want.
$ sudo chown -R $USER:$USER $HOME/.config/rclone
Create your rclone.conf
$ rclone config
I assume most use Google Drive so make sure you create your own client_id
[googledrive]
type = drive
client_id = <CLIENTID>
client_secret = <CLIENTSECRET>
scope = drive
token = {"access_token":"**********"}
server_side_across_configs = true
[googledrive_encrypt]
type = crypt
remote = googledrive:encrypt
filename_encryption = standard
directory_name_encryption = true
password = <PASSWORD>
password2 = <PASSWORDSALT>
View this step in a video example
Do not run these scripts as sudo/root unless you are running everything as root or you will have permission problems
The recommended way to mount your Google Drive is to use systemd which you can find in "rclone" folder. Make sure you create the folders first then move them into "/etc/systemd/system" Then you would only need to use the "rclone-upload" script.
Make sure you edited fuse.conf first CLICK HERE TO GO BACK
Configure the rclone-mount script. You only need to modify the "CONFIGURE" section
Type "id $USER" This gives you UserID and GroupID >> PUID PGID
$ cd /mnt/sbcloud/rclone # Change to rclone scripts directory
$ nano rclone-mount # Edit the script
$ rclone-mount # Run the script
# CONFIGURE
REMOTE="googledrive" # Name of rclone remote mount NOTE: Choose your encrypted remote for sensitive data
MEDIA="media" # Local share name NOTE: This is the directory you share to "Radarr,Sonarr,Plex,etc" EX: "/mnt/media"
USERID="1000" # Your user ID
GROUPID="1000" # Your group ID
Configure the rclone-unmount script. You only need to modify the "CONFIGURE" section
$ cd /mnt/sbcloud/rclone # Change to rclone scripts directory
$ nano rclone-unmount # Edit the script
$ rclone-unmount # Run the script
# CONFIGURE
MEDIA="media" # Local share name NOTE: This is the directory you share to "Radarr,Sonarr,Plex,etc" EX: "/mnt/media"
Configure the rclone-upload script. You only need to modify the "CONFIGURE" section
$ cd /mnt/sbcloud/rclone # Change to rclone scripts directory
$ nano rclone-upload # Edit the script
$ rclone-upload # Run the script
# CONFIGURE
REMOTE="googledrive" # Name of rclone remote mount NOTE: Choose your encrypted remote for sensitive data
UPLOADREMOTE="googledrive_upload" # If you have a second remote created for uploads put it here. Otherwise use the same remote as REMOTE
MEDIA="media" # Local share name NOTE: The name you want to give your share mount
UPLOADLIMIT="75M" # Set your upload speed Ex. 10Mbps is 1.25M (Megabytes/s)
# SERVICE ACCOUNTS
# Drop your .json files in your "appdata/rclonedata/service_accounts"
# Name them "sa_account1.json" "sa_account2.json" etc.
USESERVICEACCOUNT="N" # Y/N. Choose whether to use Service Accounts NOTE: Bypass Google 750GB upload limit
SERVICEACCOUNTNUM="15" # Integer number of service accounts to use.
# DISCORD NOTIFICATIONS
DISCORD_WEBHOOK_URL="" # Enter your Discord Webhook URL for notifications. Otherwise leave empty to disable
DISCORD_ICON_OVERRIDE="https://raw.githubusercontent.com/rclone/rclone/master/graphics/logo/logo_symbol/logo_symbol_color_256px.png" # The bot user image
DISCORD_NAME_OVERRIDE="RCLONE" # The bot user name
After you have configured each script run them manually to check if they are working. The scripts are on PATH so you may run from any directory. Make sure they are executable, if not look up how in the Set Permissions section
$ rclone-mount
View how to configure and run these scripts in a video example
Add each script to crontab: rclone-mount, rclone-unmount, rclone-upload
Example: 0 */1 * * * /mnt/sbcloud/rclone/rclone-mount > /mnt/logs/rclone-mount.log 2>&1
$ crontab -e
$ rclone-cron
I recommend if your just starting with Docker to use DockSTARTer as it will help you manage and get started in an easy way.
You can install and configure Docker Containers very easily using Portainer. The docker-manager script can also help you get started.
Recommended Dockers from Linuxserver
- Letsencrypt
- Nzbget
- Sonarr
- Radarr
- Ouroboros
- Heimdall
- 4/03/2020 - v0.06 - Script compatability and Unmount Script simplified
- 3/03/2020 - v0.05 - Discord notifications and Service Accounts
- 2/29/2020 - v0.04 - Script Revision
- 2/18/2020 - v0.03 - Initial release
- 3/17/2020 - v0.07 - Update Rclone scripts specificly
- 3/16/2020 - v0.06 - Lite version added with name update
- 3/13/2020 - v0.05 - Added Uninstaller
- 3/05/2020 - v0.04 - Script factory resets and simple UI script
- 3/04/2020 - v0.03 - Script modifies fuse.conf
- 3/03/2020 - v0.02 - Added Watchtower
- 3/02/2020 - v0.01 - Combine all install scripts into one
This project makes use of, integrates with, or was inspired by the following projects:
- BinsonBuzz Original Rclone Scripts
- no5tyle for Discord notifications
- DockSTARTer Docker system manager