From a5b894ac9c583066da6fbd144b85d24f0ed58568 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Mon, 20 Feb 2012 00:50:31 +0000 Subject: Update documentation --- README | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'README') diff --git a/README b/README index 5d855c2..e8618e2 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -modbuslog - 2012/01/10 +modbuslog - 2012/02/20 -------------------- modbuslog is a program designed to read from a modbus device at predefined @@ -7,7 +7,7 @@ intervals and store the output to file. Compilation: -------------------- -modbuslog requires the libconfig (>1.4.8) and libmodbus (>3.0.1) libraries, +modbuslog requires the libconfig (>=1.4.8) and libmodbus (>=3.0.1) libraries, and will not function without these libraries installed. Neither of these libraries are currently available (or if they are, are not of sufficient version) in the current Debian Stable release codenamed "Squeeze". This @@ -28,10 +28,12 @@ libconfig: An older, incompatible version of libconfig currently exists modbuslog uses a Makefile to ease compilation, and as such, can be compiled by simple navigating to the directory and running "make". This will recompile -any packages that need to be compiled. +any files that need to be compiled. These files can then be moved to the required directories on the target system. +Alternatively, if the code is being compiled on the target system itself, +"make install" can be used to both compile and install the software. Required files: -------------------- -- cgit v1.2.3 From a6a6f9c5a4ddc0295bb12fd93ed0ba23ed696122 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Mon, 20 Feb 2012 11:25:26 +0000 Subject: Prune archive after 3 months --- Makefile | 1 + README | 1 + src/ftpupload | 5 +++++ 3 files changed, 7 insertions(+) (limited to 'README') diff --git a/Makefile b/Makefile index a619764..7659c27 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ install: all then \ mkdir $(MODBUSLOGLOGDIR); \ mkdir $(MODBUSLOGLOGDIR)/interval; \ + mkdir $(MODBUSLOGLOGDIR)/archive; \ fi test -f $(MODBUSLOGLOGDIR)/interval/interval.txt || $(INSTALL) -m 644 $(SDIR)/interval.txt $(MODBUSLOGLOGDIR)/interval/interval.txt $(INSTALL) $(SDIR)/ftpupload $(FTPHELPERDIR)/ftpupload diff --git a/README b/README index e8618e2..151a255 100644 --- a/README +++ b/README @@ -44,6 +44,7 @@ Required files: /etc/modbuslog.cfg configuration file /var/modbuslog/ output directory where logs are stored /var/modbuslog/interval/interval.txt textfile storing unique interval +/var/modbuslog/archive/ directory containing archived log files /var/www/ webserver directory for php scripts Configuration: diff --git a/src/ftpupload b/src/ftpupload index 2483764..7d46f46 100755 --- a/src/ftpupload +++ b/src/ftpupload @@ -20,4 +20,9 @@ mput $FILE bye EOF +# move file to archive mv $FILE /var/modbuslog/archive/ + +# remove files after 3 months +CLEANUP="/var/modbus/archive/"`/usr/bin/ftphelper --mac`"_"`date +%Y_%m --date='4 months ago'`"*.log" +rm $CLEANUP -- cgit v1.2.3