Monday, June 8, 2015

email previous day log files


#!/bin/bash

cd /var/log

fil=$(mktemp)
stat -c "%y|%n" rpmpkgs-*.gz | grep `date  --date="1 days ago" +%Y-%m-%d` | awk -F"|" '{print $2}' > $fil

for i in `cat $fil`;
do
/usr/bin/uuencode $i |  mail -s "$i" youremail@example.com
done

rm $fil

Have a great day!

rsync with delete option and different ssh port

How to rsync e.g PIPELINE dir from Source to Destination? #rsync -avzr   --delete-before  -e "ssh -p $portNumber"  /local...