Skip to content

Using Rclone with Nebraska's OneDrive

Support for UNK, UNL, and UNO only

Currently this feature is only available to students, staff, faculty and affiliates at the University of Nebraska at Kearney, the University of Nebraska-Lincoln, and the University of Nebraska at Omaha.

Rclone is an open source file transfer tool to make transfering files to and from various cloud resources such as Box, Amazon S3, Microsoft OneDrive, and Google Cloud Storage and your local machine a simpler task. Guides on how to set up a variety of resources to transfer to and from can be found at rclone's webpage.

This tool can be used to transfer files between HCC clusters and outside cloud providers, such as OneDrive.

Setup RClone

  1. You must be able to access your NU Office365 account before beginning this process. Contact your local campus IT support if you need help with initial account setup.

  2. Open a browser on your local machine and navigate to the On-Demand portal for the cluster of your choice. We use Swan for this example: https://swan-ood.unl.edu.
    Select Desktop under Interactive Apps in the menu at the top of the page to get a virtual desktop on the cluster.

    Scroll down to the bottom of the next page, and click on the blue Launch button. When the resource is ready, click on the blue Launch Desktop button that appears on the next page.

    On the virtual desktop, click on the Web Browser icon at the bottom of the window to open a Firefox window.

  3. Enter the URL https://uofnebraska-my.sharepoint.com to open the nebraska.edu SharePoint site:

  4. Log into SharePoint using your nebraska.edu (TrueYou) credentials,

    where XXXXXXX is your NUID. Ensure you can see your files.

  5. On the virtual desktop, click on the Terminal Emulator icon at the bottom of the window to open up a command shell.

    Run the following commands in the terminal window to setup a new remote named "NUOD" in Rclone

    Setup NU OneDrive from the terminal

    [appstest@c1207 ~]$ module purge
    [appstest@c1207 ~]$ module load rclone
    [appstest@c1207 ~]$ rclone config create NUOD onedrive
    

  6. The browser window should automatically open a new tab and complete the setup in OneDrive. You should see a success page similar to:

  7. Switch back to the terminal. Rclone should have exited back to the command prompt without any errors. To verify the remote is setup, run rclone listremotes and confirm the "NUOD" remote is listed:

    Now test the connection by running the lsf command. You should see a listing of your OneDrive files.

    List contents of OneDrive

    [appstest@c1207 ~]$ rclone lsf NUOD:/
    

    Tip

    Using the Open OnDemand Desktop app is only required for initial setup of the remote and renewing credentials. After the setup, rclone may be used from a plain command prompt, i.e. when connecting via PuTTY in Windows or Terminal on Mac.

  8. To upload or download files, use the rclone copy command. For example:

    Transferring files

    [appstest@c1207 ~]$ rclone copy NUOD:/SomeFile.txt ./
    [appstest@c1207 ~]$ rclone copy ./SomeFile.txt NUOD:/
    
  9. To download directories, use the rclone copy command and use directory names over file. This copies the contents of the folders, so you need to specify a destination folder.

    Download a directory from OneDrive

    [appstest@c1207 ~]$ rclone copy NUOD:/my_hcc_dir ./my_hcc_dir
    

    To upload a directory named my_hcc_dir to OneDrive, use rclone copy.

    Upload a directory to OneDrive

    [appstest@c1207 ~]$ rclone copy ./my_hcc_dir NUOD:/my_hcc_dir
    
  10. Rclone also supports using sync to transfer files, similar to rsync. The syntax is similar to rclone copy. This would only transfer files that are updated by name, checksum, or time. The example below would sync the files of the local directory to the remote directory on OneDrive.

    transfer.sh

    [appstest@c1207 ~]$ rclone sync ./my_hcc_dir NUOD:/my_hcc_dir
    
  11. To delete the remote and remove any stored credentials, use the delete subcommand.

    Delete the remote from Rclone

    [appstest@c1207 ~]$ rclone config delete NUOD