From d240a8717f921e3b30d4d9bf2928af5e9b081945 Mon Sep 17 00:00:00 2001 From: Cas Satter Date: Fri, 12 Apr 2019 16:32:46 +0200 Subject: [PATCH 1/2] [TASK] - Add tar_ssh_pipe command First parameter is for the host configured in .ssh/config, second for the directory and third for the filename --- .bash_xp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.bash_xp b/.bash_xp index b90225a..9fb4c6b 100644 --- a/.bash_xp +++ b/.bash_xp @@ -114,3 +114,13 @@ function parse_git_tag() { # Git Tag # PS1 Line PS1="\[\e[00;33m\]\u\[\e[0m\]\[\e[00;37m\]@\h:\[\e[0m\]\[\e[0;31m\]\`parse_git_branch\`\[\e[m\]\[\e[0m\]\[\e[0;38m\]\`parse_git_tag\`\[\e[m\]\[\e[00;36m\][\w]\[\e[0m\]\[\e[00;32m\]\nbash> \[\e[0m\]" + +# Tar SSH Pipe +tar_ssh_pipe () +{ + if [ $# -eq 3 ]; then + ssh $1 "cd $2 && tar -cf - * | gzip -9" > $3.tar.gz + else + echo "No host, directory path and filename specified" + fi; +} From d52a596ba87fccb70e21303b68bc6f06be099205 Mon Sep 17 00:00:00 2001 From: Cas Satter Date: Fri, 12 Apr 2019 16:46:57 +0200 Subject: [PATCH 2/2] [TASK] - Add a better description to command --- .bash_xp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bash_xp b/.bash_xp index 9fb4c6b..c0d7c30 100644 --- a/.bash_xp +++ b/.bash_xp @@ -115,7 +115,7 @@ function parse_git_tag() { # Git Tag # PS1 Line PS1="\[\e[00;33m\]\u\[\e[0m\]\[\e[00;37m\]@\h:\[\e[0m\]\[\e[0;31m\]\`parse_git_branch\`\[\e[m\]\[\e[0m\]\[\e[0;38m\]\`parse_git_tag\`\[\e[m\]\[\e[00;36m\][\w]\[\e[0m\]\[\e[00;32m\]\nbash> \[\e[0m\]" -# Tar SSH Pipe +# Create a SSH connection, go to a directory and creates a tar.gz with the contents found tar_ssh_pipe () { if [ $# -eq 3 ]; then