Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan Willitts JonathanWillitts

View GitHub Profile
@JonathanWillitts
JonathanWillitts / download_latest_db.sh
Last active Apr 12, 2021
Download latest database backup archive (*.sql file) from a remote server
View download_latest_db.sh
#!/bin/bash
################################################################################
# Searches remote directory for newest *.sql file and downloads it to current
# directory
#
# Usage: bash download_latest_db.sh <db_dir_name>
#
# Note: requires values for $REMOTE_USER, $REMOTE_HOST and $REMOTE_BACKUP_ROOT
# to be set in corresponding env_variables.conf file
################################################################################