Skip to content

Instantly share code, notes, and snippets.

@tomredsky
Created October 8, 2019 09:53
Show Gist options
  • Save tomredsky/bac843682bd634b5dbb0e855242e6447 to your computer and use it in GitHub Desktop.
Save tomredsky/bac843682bd634b5dbb0e855242e6447 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# simple pipe_address script to dump mails for 'juno-crm' into 'sirius2::juno/' rsyncd share for processing
#
# ( see: ansible:roles/rsyncd )
# Revision: removed '--perm' arg. 1) it's --perms and 2) let the receiver manager perms
tmp="/tmp/juno_$$"
cat - | tee ${tmp} | head -n 5 | grep ' id' | awk '{ print $2 }' > ${tmp}_id
rsync --remove-source-files $tmp 192.168.0.171::juno/$( date +%s )_$( cat ${tmp}_id ).eml
rm ${tmp}_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment