From 43880652a0faf80ec6cf4dea4faae89d29022e81 Mon Sep 17 00:00:00 2001 From: Stephen Soltesz Date: Tue, 28 Sep 2010 23:48:02 +0000 Subject: [PATCH] simple incremental collection script, and environment variable for ssh --- histlog/collect_log_sh | 20 ++++++++++++++++++++ histlog/environment | 1 + 2 files changed, 21 insertions(+) create mode 100644 histlog/collect_log_sh create mode 100644 histlog/environment diff --git a/histlog/collect_log_sh b/histlog/collect_log_sh new file mode 100644 index 0000000..b8d535e --- /dev/null +++ b/histlog/collect_log_sh @@ -0,0 +1,20 @@ +#!/bin/bash +function upload_log () +{ + file=$1 + path=$2 + old=/tmp/$( basename $file ).old + new=/tmp/$( basename $file ).new + log=/tmp/$( basename $file ).log + touch $old + cp $file $new + comm -1 -3 $old $new > $log + cp $new $old + if [ $( stat -c %s $log ) -ne 0 ] ; then + curl --insecure https://monitor.planet-lab.org/monitor/uploadlogs --form "dir=$path" --form "log=@$log" + fi +} + +upload_log ~/.bash_eternal_history hist +#upload_log /var/log/secure hist + diff --git a/histlog/environment b/histlog/environment new file mode 100644 index 0000000..383a16a --- /dev/null +++ b/histlog/environment @@ -0,0 +1 @@ +LD_PRELOAD=/usr/lib/snoopy.so -- 2.43.0