Your OneDrive in VUB#

You can directly copy files between Hydra and your OneDrive in VUB using the third-party sync app OneDrive Client for Linux. This method avoids any additional step to copy the files to/from OneDrive to/your your local computer before transferring them to the HPC.

Warning

Several restrictions and limitations apply to OneDrive:

  • OneDrive does not discriminate capitalization in file names. Avoid having two files in the same folder that only differ in the capitalization.

  • OneDrive does not allow filenames that contain any of the characters \/:*?""<>|. Files that contain any of these characters will not be synced.

  • The following names aren’t allowed for files or folders: .lock, CON, PRN, AUX, NUL, COM0 - COM9, LPT0 - LPT9, _vti_, desktop.ini, any filename starting with ~$.

  • “_vti_” cannot appear anywhere in a file name.

  • “forms” isn’t supported when the folder is at the root level for a library.

  • You can’t create a folder name in SharePoint that begins with a tilde (~).

Client authorization#

  1. Start by executing the command onedrive in a terminal shell on Hydra. The first time it will print the following information on screen:

    onedrive
    

    Upon execution, a URL starting with https://login.microsoftonline.com is shown to authorize the client to access your VUB Office 365 account. The URL contains the client_id of the sync app, which should be exactly d50ca740-c83f-4d1b-b616-12c519384f0c:

    Listing 1 Output:#
    $ onedrive
    Configuring Global Azure AD Endpoints
    Authorize this app visiting:
    
    https://login.microsoftonline.com/[...]
    
    Enter the response uri:
    
  2. Copy/paste the full URL in your browser

  3. Log in with your credentials if necessary. You should be redirected to a blank page in your browser

  4. Copy/paste the URL of the blank page into the prompt of onedrive in Hydra

At this point, if there is no error, your client should have access to your account. By default, the access token to Office 365 is stored in the file ~/.config/onedrive/refresh_token

Synchronize with personal OneDrive#

  1. Create a directory that will be synced with your OneDrive.

    The following command creates the sync directory hydra-sync inside $VSC_DATA/onedrive (avoid using $HOME as it is small).

    mkdir -p $VSC_DATA/onedrive/hydra-sync
    
  2. Create the configuration file ~/.config/onedrive/config.

    The following commands generate the config file. The entry sync_dir is mandatory and points to the parent directory of the sync directory. Also, we recommend to skip syncing symlinks and dotfiles (files that start with a dot) by default to avoid unexpected data transfers unless you know that you need those.

    config=~/.config/onedrive/config
    echo sync_dir = \"$VSC_DATA/onedrive\" > $config
    echo 'skip_symlinks = "true"' >> $config
    echo 'skip_dotfiles = "true"' >> $config
    
  3. Create the sync_list file ~/.config/onedrive/sync_list.

    The following command adds the sync directory hydra-sync to the sync_list file. This ensures that only data inside the sync directory is synced.

    echo hydra-sync > ~/.config/onedrive/sync_list
    
  4. Check if the OneDrive client has been configured correctly.

    onedrive --resync --synchronize --verbose --dry-run
    
  5. If the dry-run succeeded, re-run the above command but remove the --dry-run option to do the real sync.

    onedrive --resync --synchronize --verbose
    

    If the sync is successful, the sync directory (here: hydra-sync) should show up under My files in your VUB OneDrive.

  6. For subsequent synchronizations, remove also the --resync option to avoid any further full synchronization. A resync is only needed after modifying the configuration or sync_list file.

    onedrive --synchronize --verbose