aboutsummaryrefslogtreecommitdiffstats
path: root/src/ftpupload
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-03-13 00:59:48 +0000
committerJonathan McCrohan <jmccrohan@gmail.com>2012-03-13 00:59:48 +0000
commitef40490b47e4ffa64ffae41b43ee5096d1460ece (patch)
tree0ccb3853d28be9e96ea8b2207de489cdcff51f06 /src/ftpupload
parent267d9a07255d96a564da64ce5c819ebc4701d5f1 (diff)
downloadverteco-ef40490b47e4ffa64ffae41b43ee5096d1460ece.tar.gz
ftpupload: use fully qualified paths
cron requires them
Diffstat (limited to 'src/ftpupload')
-rwxr-xr-xsrc/ftpupload13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ftpupload b/src/ftpupload
index 09dfe4d..01cbdb2 100755
--- a/src/ftpupload
+++ b/src/ftpupload
@@ -20,15 +20,18 @@ FIVEDAYLOG=`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='4 days ago'`"_00
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 /var/modbuslog/
+
# move file to archive
-mv $CURRENTLOG /var/modbuslog/archive/
+/bin/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/archive/
# login to remote server and upload
-ftp -n -v -i $SERVER <<EOF
+/usr/bin/ftp -n -v -i $SERVER <<EOF
user $USERNAME $PASSWORD
cd $REMOTEDIRECTORY
mput $CURRENTLOG
@@ -41,6 +44,10 @@ mput $SEVENDAYLOG
bye
EOF
+EXITSTATUS=$?
+
# remove files after 3 months
CLEANUP="/var/modbus/archive/"`/usr/bin/ftphelper --mac`"_"`date +%Y_%m --date='4 months ago'`"*.log"
-rm $CLEANUP
+/bin/rm $CLEANUP
+
+exit $EXITSTATUS
td>hwmon patch from Hans de Goedemichael1-0/+14 2011-07-27patch to support SureElectronicsDE-LD023 from Matt Joicemichael1-3/+16 2011-05-06Fixed keypad widget in GLCD2USBharbaum1-0/+7 2011-02-12timer.c: fixed detection of positive clock skew (and some typos)mzuther4-10/+10 2011-01-23timer.c: fixed clock skew detectionmzuther1-26/+46 2011-01-23timer.c: skip intermediate timer intervalsmzuther2-16/+46 2011-01-05fix for a bug introduced in the DE-LD021 drivermichael1-3/+3 2011-01-04indentationmichael2-3/+3 2011-01-04support for Sure Electronics DE-LD021 by Natanael Olaizmichael1-10/+8 2011-01-02driver for EFN LED modules by Tilman Glötznermichael9-21/+469 2010-11-28commented, corrected and beautified both timer and timer group codemzuther11-197/+511 2010-11-27finished commenting the timer codemzuther2-46/+138 2010-11-20started commenting the timer codemzuther5-52/+170 2010-11-19Added brightness support for GLCD2USBharbaum5-28/+8014