Transferring Data to Your UCSB Box Account using lftp

First - Set an External Password for your Box Account

You'll only need to complete the following steps once:

  1. Set up an "external password" on your UCSB Box account. This enables your account to be accessed via methods other than single sign-on, such as via the FTPS protocol.
  2. Log into your Box account (
  3. From the dropdown menu with your name, near the upper right, select Account Settings.
  4. Scroll down to the Create External Password section.
  5. Click the Edit Password link.
  6. Follow the onscreen prompts to create and save your external password.  Note the password does NOT have to be your UCSBnetID/Box password.

To mirror a local directory to Box it's generally easiest to create a script that connects to box and handles the lftp commands. Using your favorite editor create a script that looks like:

lftp -c 'open -e "set ftps:initial-prot ""; \
   set ftp:ssl-force true; \
   set ftp:ssl-protect-data true; \
   open ftps://; \
   user; \
   mkdir myfolder; \
   mirror --reverse --delete --no-perms --verbose "/home/username/myfolder" myfolder;" '

This forces encryption and creates the remote directory.  You'll have to enter the external password you created.  Note that you should be careful with lftp as it will delete items.  If 'myfolder' already exists, you don't need to create it again.  You might want to make your script executably by issuing a:

chmod 700 myscriptname

Also note that UCSB's data transfer rate to Box is limited and pretty slow.