Install RClone for synching Server contents to Cloud storage- google drive, onedrive, dropbox or own/nextcloud

Use case with Jibri Recorded content to push to cloud storage operators.

Rclone installation (Debian 10)

All below commands are executed as ‘root’. (I know!..)

apt update
apt install curl -y
curl https://rclone.org/install.sh | bash

Rclone is now installed. We need to find where rclone expects it’s config file:

rclone config file

Response:

Configuration file doesn’t exist, but rclone will use this path:
/root/.config/rclone/rclone.conf

So we need to upload the file from our windows pc/laptop (C:\Users\[user]\.config\rclone\rclone.conf) to the location on the Jibri server (/root/.config/rclone/rclone.conf). (I used WinSCP for this). After upload, we check once more to be sure rclone finds it’s config:

rclone config file

Rest you can select and start creating your own synching provider.

Configuration file is stored at:

/root/.config/rclone/rclone.conf

To sync recorded files to our Google drive, we can run a command like:

rclone copy /srv/recordings/ googledrive:meet.myfirewall.org/videos/ -v --log file=/var/log/jitsi/jibri/googledrive_upload.log

Creating the Sync Script for Jibri recording:

We copy the rclone config file to a location where the jibri-user can read it (currently only ‘root’ can read the file):

rsync --recursive ~/.config/rclone/rclone.conf /home/jibri/.config/rclone/

And then we create the upload script:

touch /etc/jitsi/jibri/rclone.googledrive.upload.sh
chmod +x /etc/jitsi/jibri/rclone.googledrive.upload.sh
nano /etc/jitsi/jibri/rclone.googledrive.upload.sh

Copy below text in the script:

#! /usr/bin/bash
# Rclone can be invoked to upload local recording to a remote location at a cloud provider.
/usr/bin/rclone copy /srv/recordings/ googledrive:[your.domain.com]/videos/ -v --log-file=/var/log/jitsi/jibri/jitsi_googledrive_upload.log

Run the script and check the log:

/etc/jitsi/jibri/rclone.googledrive.upload.sh

(log can be found at /var/log/jitsi/jibri/jitsi_googledrive_upload.log)

Setting Jibri to call our Script

Finally we make sure Jibri will finalize the recording by uploading our video to Google Drive:

nano /etc/jitsi/jibri/config.json

// The path to the script which will be run on completed recordings “finalize_recording_script_path”:

/etc/jitsi/jibri/rclone.googledrive.upload.sh",

All should be good for automated immediate uploads when recording is finished!

Src: https://community.jitsi.org/t/how-to-to-get-a-working-setup-of-google-drive-one-drive-or-other-cloud-services-in-jibri-my-comprehensive-tutorial-for-the-beginner/42228

Share

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.