aboutsummaryrefslogtreecommitdiffstats
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
parent267d9a07255d96a564da64ce5c819ebc4701d5f1 (diff)
downloadverteco-ef40490b47e4ffa64ffae41b43ee5096d1460ece.tar.gz
ftpupload: use fully qualified paths
cron requires them
-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
09.d26b627-1&id=f5a002e361636dd41dc84a5fa1a2e1ee77862edb&follow=1'>Imported Upstream version 0+git20140512.1246b27upstream/0+git20140512.1246b27Jonathan McCrohan391-301/+3983 2014-04-05Release 0+git20140326.cfc2975-1debian/0+git20140326.cfc2975-1Jonathan McCrohan1-2/+2 2014-04-05d/control: update Homepage (upstream has moved from Gitweb to cgit)Jonathan McCrohan2-1/+2 2014-04-05New Upstream Snapshot (commit cfc2975)Jonathan McCrohan1-0/+6 2014-04-05Imported Upstream version 0+git20140326.cfc2975upstream/0+git20140326.cfc2975Jonathan McCrohan118-656/+877 2014-01-16Release 0+git20140107.1850cf8-1debian/0+git20140107.1850cf8-1Jonathan McCrohan1-2/+2 2014-01-16Update Standards Version to 3.9.5Jonathan McCrohan2-1/+9