Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. You need to create your UNL Box.com account here.
     
  2. Since we are going to be using webdav 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 > Create External Password.

     
  3. Create a .netrc file in order to automatically login to your box account without typing the password.  The file needs to be in your home directory, ie ~/.netrc.  You can easily create this file using the nano text editor by using the command:

    Code Block
    nano ~/.netrc

    The file should contain the following lines:

    Code Block
    machine dav.box.com
    	login <box_username>@unl.edu
    	password <external_password>

    Once you have typed or pasted these lines into the file, press CTRL-X to exit. Follow the prompts to save the file as .netrc.

  4. Be sure to have the correct permissions on the file.  You can change the permissions with the command:

    Code Block
    $ chmod 600 ~/.netrc


  5. Try out the webdav client by issuing the command:

    Code Block
    $ cadaver https://dav.box.com/dav

    It should give you a prompt like:

    Code Block
    dav:/dav/> 

    Within this prompt, you can view files and navigate through the file system using the usual Bash commands cd and ls. To download files from Box, use the command:

    Code Block
    get <filename>

    Or, alternately, to upload files to your Box, use:

    Code Block
    put <filename>

    To exit the prompt, press ctrl-d

  6. Within a submit script, you can upload and download files by using commands such as:

    Code Block
    #!/bin/sh
    #SBATCH ...
    ....
    cat << EOF | cadaver https://dav.box.com/dav 
    get inputfile.txt
    EOF
     
    cat << EOF | cadaver https://dav.box.com/dav 
    put outputfile.txt
    EOF


  7. The files should automatically appear in your Box account, and be sync'd to your computer if you have the sync client installed.

...