Skip to content

SFTP

Transfer files between local and remote servers via SFTP.

DAG-Level Configuration

yaml
ssh:
  user: deploy
  host: server.example.com
  key: ~/.ssh/deploy_key

steps:
  - name: upload-config
    type: sftp
    config:
      direction: upload
      source: /local/config.yaml
      destination: /remote/config.yaml

  - name: download-logs
    type: sftp
    config:
      direction: download
      source: /var/log/app.log
      destination: /local/app.log

Step-Level Configuration

yaml
steps:
  - name: upload-file
    type: sftp
    config:
      user: deploy
      host: server.example.com
      key: ~/.ssh/deploy_key
      direction: upload
      source: /local/file.txt
      destination: /remote/file.txt

Configuration

FieldRequiredDefaultDescription
userYes-SSH username
hostYes-SSH hostname
portNo22SSH port
keyNoAuto-detectPrivate key path
passwordNo-SSH password
strict_host_keyNotrueEnable host key verification
known_host_fileNo~/.ssh/known_hostsKnown hosts file path
timeoutNo30sConnection timeout
directionNouploadupload or download
sourceYes-Source path (local for upload, remote for download)
destinationYes-Destination path (remote for upload, local for download)
bastionNo-Bastion host configuration (same as SSH)

Directory Transfer

Directories are transferred recursively:

yaml
steps:
  - name: upload-dir
    type: sftp
    config:
      direction: upload
      source: /local/project/
      destination: /remote/project/

  - name: download-dir
    type: sftp
    config:
      direction: download
      source: /remote/backup/
      destination: /local/backup/

Atomic Uploads

Uploads write to a temporary file (.boltbase-tmp-{random}) then rename to the final destination. This prevents partial files on failure.

See Also

  • SSH - Remote command execution
  • S3 - S3 file operations

Released under the MIT License.