Body
Rclone is installed on FAU Research Computing Services and available via module load module load rclone-1.59.1-gcc-9.4.0-k53kthf (this may change on different hardware so use module load avail to search)
Rclone is an open source command line program to sync files and directories to and from local storage to cloud based storage, such as Google Workspace and Microsoft OneDrive.
Using Rclone is not formally supported by Office of Information Technology Research Computing but We will try to keep the software up to date and help users only on an available effort basis. There is no guarantee that the software is fully compatible or will remain compatible with Microsoft OneDrive or Google Workspace.
Below is a guide to using Rclone with OneDrive and further information can be found in the Rclone documentation
Setting up a rclone Environment
From a terminal on NX run the following command to set up your environment. This is a one-time operation as the configuration is held in your home directory.
rclone config
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q>
No remote environments exist yet, so we will select ‘n’
You will then be asked to choose a name for the connection. We recommend using ‘remote’ as this is the same as our examples below.
n/s/q> n
name> remote
From the list of options select the one for Microsoft One Drive. In our example below it’s 21, please check the list on your screen as option numbers can change in future versions.
21 / Microsoft OneDrive
\ "onedrive"
Storage> 21
Microsoft App Client Id - leave blank normally.
client_id>
Microsoft App Client Secret - leave blank normally.
client_secret>
Edit advanced config? (y/n)
y) Yes
n) No
y/n> n
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> n
Follow on screen instructions to copy and paste the code
Your browser will then be launched requesting a login to OneDrive for Business. This is your netid and password.
Once you have logged you will be asked for the type OneDrive i.e personal/business and select the drive you want to use from those found.
Choose a number from below, or type in an existing value
1 / OneDrive Personal or Business
\ "onedrive"
2 / Root Sharepoint site
\ "sharepoint"
3 / Type in driveID
\ "driveid"
4 / Type in SiteID
\ "siteid"
5 / Search a Sharepoint site
\ "search"
Your choice> 1
Found 1 drives, please select the one you want to use:
0: OneDrive (business) id=b!CuZrqPHEFU636x6rqYAhRKnMdCmvgrLQQDmo-AoHYueOlvEmgiQHbbL
Chose drive to use:> 0
Found drive 'root' of type 'business', URL: https://fau.sharepoint.com/personal/netid@fau.edu/Documents
Is that okay?
y) Yes
n) No
y/n> y
You then need to confirm your environment Select ‘y‘ to save and then ‘q‘ to quit the setup.
Initiating a Backup to OneDrive
List directories in top level of your OneDrive
rclone lsd remote:
List all the files in your OneDrive
rclone ls remote:
To copy a local directory to an OneDrive directory called backup
rclone copy ~/source remote:backup
To copy a network directory to an OneDrive directory called network
rclone copy /storage/silver/example remote:net/example
To mount your OneDrive directory using fusemount into your home directory
rclone --vfs-cache-mode writes mount remote: ~/OneDrive &
Note that OneDrive is case insensitive so you can’t have a file called “Hello.doc” and one called “hello.doc”.
There are quite a few characters that can’t be in OneDrive file names. These can’t occur on Windows platforms, but on non-Windows platforms they are common. Rclone will map these names to and from an identical-looking Unicode equivalent. For example, if a file has a ? in it will be mapped to ? instead.
The largest allowed file size is 100GiB as of 17th June 2020
If you don’t use rclone for 90 days the refresh token will expire. This will result in authorization problems. This is easy to fix by running the following command to get a new token and refresh token.
rclone config reconnect remote
For older versions of rclone you have to use the edit command to refresh the token
rclone config edit
See using rclone with onedrive for more information