Backup on box.com on Linux (works at KTH)

by Martin Monperrus

Backup with rclone

rclone works best:

  rclone config (then choose "box.com")
  rclone -v sync --one-file-system --exclude-from /home/martin/exclude-list-rsync.txt local:/home/martin box:backup-rclone

Backup with LFTP

  1. Set up your box.com password: If box.com is configured with SSO (the case for KTH), you must first create an external password, see Creating and using an external password for Enterprise Box for instructions.
  2. Save your login information. In order to automatically connect, the password must be stored in a file called .lftp/bookmarks. Here, monp@kth.se is my login and pass123 is my password Box ftps://monp@kth.se:pass123@ftp.box.com:990
  3. Create a lftp script backup.lftp (see below)
  4. Run the script lftp -f backup.lftp
set ftps:initial-prot ""
set ftp:ssl-force true
set ftp:ssl-protect-data true

# speed up the backup
set ftp:use-mode-z true
set ftp:mode-z-level 9
set mirror:parallel-directories true
# must be lower than 40, otherwise the error message is "Login rejected: Limit of 40 logins per user already reached"
set  mirror:parallel-transfer-count 39

# important if you're on a NAT network
set passive true

# "Box" refers to .lftp/bookmarks
open Box
# equivalent to "open ftps://ftp.box.com:990"

# box.com's FTP does not support symbolic links: "Access failed: 502 Command SITE not implemented for SYMLINK"
mirror --reverse --delete --no-perms --no-symlinks "/home/martin" backup

Acknowledgements

Using Box under Linux

Tagged as: