aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-03-12 00:15:48 +0000
committerJonathan McCrohan <jmccrohan@gmail.com>2012-03-12 00:15:48 +0000
commit069af04a4ae3d48228cd0a03e768425cb534680e (patch)
treeb0442c415b28140029c68b5ccf151c5150380f1f
parent42915d85ecd05b97676d2fb72410c1178c425af9 (diff)
downloadverteco-069af04a4ae3d48228cd0a03e768425cb534680e.tar.gz
7 day rolling upload
-rwxr-xr-xsrc/ftpupload30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/ftpupload b/src/ftpupload
index 05ae60e..54385be 100755
--- a/src/ftpupload
+++ b/src/ftpupload
@@ -9,24 +9,38 @@ PASSWORD=`/usr/bin/ftphelper --password`
SERVER=`/usr/bin/ftphelper --server`
REMOTEDIRECTORY=`/usr/bin/ftphelper --directory`
-# local file to be uploaded
-FILE=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='1 days ago'`"_00_00_00.log"
+# current file to be uploaded
+CURRENTLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='1 days ago'`"_00_00_00.log"
+
+# upload previous 6 days for redundancy
+TWODAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='2 days ago'`"_00_00_00.log"
+THREEDAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='3 days ago'`"_00_00_00.log"
+FOURDAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='4 days ago'`"_00_00_00.log"
+FIVEDAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='5 days ago'`"_00_00_00.log"
+SIXDAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='6 days ago'`"_00_00_00.log"
+SEVENDAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='7 days ago'`"_00_00_00.log"
+
+# move file to archive
+mv $CURRENTLOG /var/modbuslog/archive/
# mput is dumb, and if we don't cd to the directory,
# it will try to save file to /var/modbuslog/MAC.....log on ftp remote
-cd /var/modbuslog/
+cd /var/modbuslog/archive/
# login to remote server and upload
-ftp -n -i $SERVER <<EOF
+ftp -n -v -i $SERVER <<EOF
user $USERNAME $PASSWORD
cd $REMOTEDIRECTORY
-mput $FILE
+mput $CURRENTLOG
+mput $TWODAYLOG
+mput $THREEDAYLOG
+mput $FOURDAYLOG
+mput $FIVEDAYLOG
+mput $SIXDAYLOG
+mput $SEVENDAYLOG
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
etions'>-11/+35 bugfixes git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@126 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-15[lcd4linux @ 2001-03-15 15:49:22 by ltoetsch]ltoetsch3-14/+27 fixed compile HD44780.c, cosmetics git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@125 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-15[lcd4linux @ 2001-03-15 14:25:05 by ltoetsch]ltoetsch11-125/+278 added unread/total news git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@124 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-15[lcd4linux @ 2001-03-15 11:10:53 by ltoetsch]ltoetsch1-1/+8 added quit/logout to pop/imap git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@123 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-15[lcd4linux @ 2001-03-15 09:47:13 by reinelt]reinelt3-16/+31 some fixes to ppdef off-by-one bug in processor.c fixed git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@122 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-15[lcd4linux @ 2001-03-15 09:13:22 by ltoetsch]ltoetsch1-2/+9 delay first exec for faster start git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@121 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-14[lcd4linux @ 2001-03-14 16:47:41 by reinelt]reinelt3-41/+59 minor cleanups git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@120 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-14[lcd4linux @ 2001-03-14 15:30:53 by reinelt]reinelt1-21/+34 make ppdev compatible to earlier kernels git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@119 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-14[lcd4linux @ 2001-03-14 15:14:59 by reinelt]reinelt8-152/+365 added ppdev parallel port access git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@118 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-14[lcd4linux @ 2001-03-14 13:19:29 by ltoetsch]ltoetsch16-128/+773 Added pop3/imap4 mail support git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@117 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-13[lcd4linux @ 2001-03-13 08:34:15 by reinelt]reinelt6-29/+50 corrected a off-by-one bug with sensors git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@116 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-13[lcd4linux @ 2001-03-13 08:03:41 by reinelt]reinelt3-1/+35 added missing autoheader files git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@115 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-13[lcd4linux @ 2001-03-13 07:53:00 by reinelt]reinelt2-13/+15 added several files for the distribution git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@114 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-13[lcd4linux @ 2001-03-13 07:41:22 by reinelt]reinelt3-2/+52 added NEWS file git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@113 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-12[lcd4linux @ 2001-03-12 13:44:58 by reinelt]reinelt8-58/+232 new udelay() using Time Stamp Counters git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@112 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-12[lcd4linux @ 2001-03-12 12:49:24 by reinelt]reinelt2-63/+71 even better configure handling... git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@111 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-12[lcd4linux @ 2001-03-12 12:39:36 by reinelt]reinelt14-448/+830 reworked autoconf a lot: drivers may be excluded, #define's went to config.h git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@110 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-09[lcd4linux @ 2001-03-09 16:24:30 by ltoetsch]ltoetsch2-155/+345 disable driver in configure git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@109 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-09[lcd4linux @ 2001-03-09 15:04:53 by reinelt]reinelt3-103/+109 rename 'raster' to 'Text in Text.c added TOTO item git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@108 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-09[lcd4linux @ 2001-03-09 14:30:01 by reinelt]reinelt1-0/+7 new ideas for TODO git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@107 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-09[lcd4linux @ 2001-03-09 14:24:49 by ltoetsch]ltoetsch3-7/+18 exec: Scale_x ->Min/Max_x git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@106 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-09[lcd4linux @ 2001-03-09 13:08:11 by ltoetsch]ltoetsch12-86/+384 Added Text driver git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@105 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-09[lcd4linux @ 2001-03-09 12:14:24 by reinelt]reinelt4-21/+34 minor cleanups git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@104 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-08[lcd4linux @ 2001-03-08 15:25:38 by ltoetsch]ltoetsch9-93/+214 improved exec git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@103 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-08[lcd4linux @ 2001-03-08 09:02:04 by reinelt]reinelt4-133/+21 seti client cleanup git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@102 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-08[lcd4linux @ 2001-03-08 08:39:54 by reinelt]reinelt2-4/+12 fixed two typos git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@101 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-07[lcd4linux @ 2001-03-07 18:10:21 by ltoetsch]ltoetsch10-110/+319 added e(x)ec commands git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@100 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-05[lcd4linux @ 2001-03-05 18:20:21 by reinelt]reinelt2-13/+25 TOTO list update git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@99 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-04[lcd4linux @ 2001-03-04 15:01:12 by ltoetsch]ltoetsch1-3/+3 Added PNG git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@98 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2001-03-02[lcd4linux @ 2001-03-02 20:18:12 by reinelt]reinelt3-36/+89 allow compile on systems without net/if_ppp.h git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@97 3ae390bd-cb1e-0410-b409-cd5a39f66f1f