Files
pg-bkup/docs/how-tos/backup-to-ftp.md
2024-09-30 00:00:21 +02:00

1.3 KiB

title, layout, parent, nav_order
title layout parent nav_order
Backup to FTP remote server default How Tos 4

Backup to FTP remote server

As described for s3 backup section, to change the storage of your backup and use FTP Remote server as storage. You need to add --storage ftp. You need to add the full remote path by adding --path /home/jkaninda/backups flag or using REMOTE_PATH environment variable.

{: .note } These environment variables are required for SSH backup FTP_HOST_NAME, FTP_USER, REMOTE_PATH, FTP_PORT or FTP_PASSWORD.

services:
  pg-bkup:
    # In production, it is advised to lock your image tag to a proper
    # release version instead of using `latest`.
    # Check https://github.com/jkaninda/pg-bkup/releases
    # for a list of available releases.
    image: jkaninda/pg-bkup
    container_name: pg-bkup
    command: backup --storage ftp -d database
    environment:
      - DB_PORT=5432
      - DB_HOST=postgres
      - DB_NAME=database
      - DB_USERNAME=username
      - DB_PASSWORD=password
      ## FTP config
      - FTP_HOST_NAME="hostname"
      - FTP_PORT=21
      - FTP_USER=user
      - FTP_PASSWORD=password
      - REMOTE_PATH=/home/jkaninda/backups

    # pg-bkup container must be connected to the same network with your database
    networks:
      - web
networks:
  web: