#!/bin/sh # ftpupload # # Copyright (C) 2012 Jonathan McCrohan USERNAME=`/usr/bin/ftphelper --username` PASSWORD=`/usr/bin/ftphelper --password` SERVER=`/usr/bin/ftphelper --server` LOCALDIRECTORY="/var/modbuslog" REMOTEDIRECTORY=`/usr/bin/ftphelper --directory` # current file to be uploaded CURRENTLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='0 days ago'`"_00_00_00.log" # upload previous 6 days for redundancy TWODAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='1 days ago'`"_00_00_00.log" THREEDAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='2 days ago'`"_00_00_00.log" FOURDAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='3 days ago'`"_00_00_00.log" FIVEDAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='4 days ago'`"_00_00_00.log" SIXDAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='5 days ago'`"_00_00_00.log" SEVENDAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='6 days ago'`"_00_00_00.log" # enter modbuslog directory cd $LOCALDIRECTORY # move file to archive /bin/mv $CURRENTLOG $LOCALDIRECTORY/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 $LOCALDIRECTORY/archive/ # login to remote server and upload /usr/bin/ftp -n -v -i $SERVER <stats
path: root/config/bootstrap (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2012-02-05Update broken handcrafted patchJonathan McCrohan1-2/+2
2012-02-05Use 3.0 (quilt)Jonathan McCrohan2-2/+2
2012-02-05Use 3.0 (quilt)Jonathan McCrohan3-0/+13
2012-02-05Use quiltJonathan McCrohan3-6/+9
2012-02-05Update changelogJonathan McCrohan1-1/+6
2012-02-05clean up packagingJonathan McCrohan2-2/+1
2012-02-05fix errorsJonathan McCrohan3-10/+3
2012-02-05Undo accidental source changesJonathan McCrohan2-9/+9
2012-02-05Add patch to remove copyingJonathan McCrohan2-1/+9