Automation

Rclone and Cyberduck guide: how to automate company backups to cloud storage using personal access tokens

A backup that depends on somebody remembering it is not a backup. This guide connects two free tools to your cloud: Cyberduck for people who prefer a window with drag and drop, and Rclone for a backup that runs by itself every night.

In short

  • Use a personal access token in tools and scripts, never your account password.
  • Cyberduck is a free graphical client: choose WebDAV (HTTPS), enter the server, your email address and the token.
  • Rclone is a command-line tool: one configuration section, then rclone sync in a scheduled task.
  • Files larger than 256 MB need the Rclone "chunker" overlay or the web portal for now.

Why a token and not the password

A script that runs every night has to store its credentials somewhere. If that is your account password, everyone who can read the script can sign in as you, and changing the password breaks every tool at once.

A personal access token is a separate key for one tool or one device. You can see when it was last used, and you can revoke it with one click. The password and all other tokens stay untouched.

  1. Sign in to the portal and open Access tokens in your profile.
  2. Click Generate access token and give it a name that says where it is used, for example "Nightly backup, office server".
  3. Copy the token immediately. It is shown only once.

Cyberduck: the graphical way

Cyberduck is a free file browser for Windows and macOS. It suits people who want to move files by hand, with a window on the left and the cloud on the right.

  1. Download Cyberduck from cyberduck.io and install it.
  2. Click Open Connection and choose WebDAV (HTTPS) from the list of protocols.
  3. Server: cloud.apaone.com, port: 443, path: /webdav/. User name: your email address. Password: the access token.
  4. Click Connect. Drag files between the Cyberduck window and your desktop, or right-click a folder and choose Synchronize to mirror a local folder.

Rclone: the automatic way

Rclone is a free, open-source command-line program for Windows, macOS and Linux. It copies and synchronises folders, checks every file and can be scheduled. Install it first:

# Windows
winget install Rclone.Rclone

# macOS
brew install rclone

# Linux
curl https://rclone.org/install.sh | sudo bash
  1. Obscure the token

    Rclone stores passwords in an obscured form. Run rclone obscure "YOUR_ACCESS_TOKEN" and copy the result.

  2. Open the configuration file

    Run rclone config file to see where the file is: %APPDATA%\rclone\rclone.conf on Windows, ~/.config/rclone/rclone.conf on macOS and Linux.

  3. Add the remote

    Add a section named [apaone] with the lines type = webdav, url = https://cloud.apaone.com/webdav/, vendor = other, user = followed by your email address and pass = followed by the obscured token. The command rclone config asks for the same values one by one.

  4. Test the connection

    Run rclone lsd apaone:. The folders of your cloud are listed.

  5. Run the first backup

    Run rclone sync with the local folder and the cloud folder, first with --dry-run, then for real with --progress.

Everyday Rclone commands

# list the folders in your cloud
rclone lsd apaone:

# copy a local folder to the cloud (never deletes anything)
rclone copy "C:\Projects\Client A" apaone:Projects/ClientA --progress

# make the cloud folder identical to the local one (deletes what is gone locally)
rclone sync "D:\Projects" apaone:Backup/projects --progress

# bring everything back from the cloud to a local disk
rclone copy apaone: "D:\Restore" --progress

Files larger than 256 MB

Over WebDAV a file travels in a single request, and the server currently accepts requests of up to 256 MB. Documents, spreadsheets and photos are far below that. Database dumps, disk images and video are not.

Rclone has an overlay for exactly this case. A chunker remote splits large files into pieces on upload and joins them again on download. Add a second section to the configuration file and use it instead of the first one:

[apaone-chunked]
type = chunker
remote = apaone:Backup
chunk_size = 200M
rclone sync "D:\Archives" apaone-chunked:archives --progress

Schedule the backup

On Linux and macOS add a line to the crontab (crontab -e). This one runs every night at 02:00 and writes a log:

0 2 * * * rclone sync /srv/projects apaone:Backup/projects --log-file ~/rclone-backup.log

On Windows open Task Scheduler, create a basic task that runs daily, choose "Start a program", enter rclone.exe as the program and this as the arguments:

sync "D:\Projects" apaone:Backup/projects --log-file "%USERPROFILE%\rclone-backup.log"

A sensible backup routine for a small company

  • One token per machine, named after the machine.
  • A nightly rclone sync of the working folders, with a log file.
  • A weekly look at the log, or at the "last used" time of the token in the portal.
  • A second copy of the most important data in another place. One copy in one cloud is not a complete backup strategy.

ApaOne Cloud plans have 10, 50, 100 and 200 GB of storage for €20, €50, €100 and €150 per month. See the plans.

Frequently asked questions

Which protocol do Rclone and Cyberduck use to connect?

WebDAV over HTTPS. In Rclone choose the "webdav" storage type with the vendor "other"; in Cyberduck choose "WebDAV (HTTPS)".

Can I use my account password instead of a token?

It works, but it is not recommended. A token can be revoked separately, shows when it was last used and does not expose the password that also protects the web portal.

What happens if I revoke a token?

The tool that used it loses access immediately. Your password, your files and all other tokens stay as they are.

Ready to give your clients a space of their own?

Choose a plan, receive your proforma invoice in euros and start working as soon as the payment is recorded.