Skip to content

Instantly share code, notes, and snippets.

@rdebeasi
rdebeasi / sshtail.sh
Last active October 1, 2015 21:47
Bash Script to feed a remote log via ssh to a local file.
#!/bin/bash
#
# Usage:
#
# server logfile/path output/path
# example sshtail.sh user@ssh.server /var/log/apache2/error.log ~/tmp/error.local.log
[ "$1" == "--help" ] && { printf "Usage: server logfile/path output/path\n"; exit; }
# Delete the file so we don't output anything until after we connect