Integrating Box with HCC
Warning
NU no longer has an active arrangement with Box.com and has migrated to Microsoft 365 services. Please visit our page on using rclone for file transfer or using OneDrive with Globus (UNL only) for instructions on how to access your NU Microsoft 365 storage from HCC resources.
The instructions below remain as a reference for use with personal or other institutional Box accounts.
Step-by-step guide for Lftp¶
-
Login to your institution or personal Box account.
-
Since we are going to be using ftps protocol to access your Box.com storage, you need to create an External Password. In the Box.com interface, you can create it at Account Settings > Account > Authentication > Create Password.
-
After logging into the cluster of your choice, load the
lftp
module by entering the command below at the prompt:Load the lftp module
module load lftp
-
Connect to Box using your full email as the username and external password you created:
Connect to Box
lftp -u <username> ftps://ftp.box.com Password: <password>
Info
Be sure to use your fully qualified username; that is, include the domain. For example,
hhusker2@example.edu
. -
Test the connection by running the
ls
command. You should see a listing of your Box files. Assuming it works, add a bookmark named "box" to use when connecting later. Optionally runset bmk:save-passwords yes
first if you want lftp to remember the password:Add lftp bookmark
lftp demo2@example.edu@ftp.box.com:/> set bmk:save-passwords yes lftp demo2@example.edu@ftp.box.com:/> bookmark add box
-
Exit
lftp
by typingquit
. To reconnect later, use bookmark name:Connect using bookmark name
lftp box
-
To upload or download files, use
get
andput
commands. For example:Transferring files
[demo2@login.swan ~]$ lftp box lftp demo2@example.edu@ftp.box.com:/> put myfile.txt lftp demo2@example.edu@ftp.box.com:/> get my_other_file.txt
-
To download directories, use the
mirror
command. To upload directories, use themirror
command with the-R
option. For example, to download a directory namedmy_box-dir
to your current directory:Download a directory from Box
[demo2@login.swan ~]$ lftp box lftp demo2@example.edu@ftp.box.com:/> mirror my_box_dir
To upload a directory named
my_hcc_dir
to Box, usemirror
with the-R
option:Upload a directory to Box
[demo2@login.swan ~]$ lftp box lftp demo2@example.edu@ftp.box.com:/> mirror -R my_hcc_dir
-
Lftp also supports using scripts to transfer files. This can be used to automatically download or upload files during jobs. For example, create a file called "transfer.sh" with the following lines:
transfer.sh
open box get some_input_file.tar.gz put my_output_file.tar.gz
To run this script, do:
Run transfer.sh
module load lftp lftp -f transfer.sh