Skip to content

Instantly share code, notes, and snippets.

@silentdth
silentdth / mirror_remote_directory_to_local_directory
Last active August 3, 2019 08:56 — forked from sinbadsalmon/mirror_local_directory_to_remote_directory_(mirror -R)
Bash script using lftp to mirror remote directory to local directory using FTPS and recursion, thus keeping the remote directory synchronized with the local one. This script uses 'mirror'.
#!/bin/sh
# @author: Simon Tipping, Ben Dodd
# @description: A script to mirror remote folder to local folder using lftp - Based on Alexandre Plennevaux's "MIRROR DISTANT FOLDER TO LOCAL FOLDER VIA FTP" script https://gist.github.com/pixeline/0f9f922cffb5a6bba97a
# This version is for FTPS and recurses all subdirectories.
# FTP LOGIN
HOST='ftps://ftp.domain.com'
USER='ftpusername'
PASSWORD='ftppassword'
# DISTANT DIRECTORY