aboutsummaryrefslogtreecommitdiffstats
path: root/src/ftpupload
blob: 7d46f46c4b9e3341ba0b81c3e49c2008823a46e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

# ftpupload
#
# Copyright (C) 2012 Jonathan McCrohan

USERNAME=`/usr/bin/ftphelper --username`
PASSWORD=`/usr/bin/ftphelper --password`
SERVER=`/usr/bin/ftphelper --server`
REMOTEDIRECTORY=`/usr/bin/ftphelper --directory`

# local file to be uploaded 
FILE="/var/modbuslog/"`/usr/bin/ftphelper --mac`"_"`date +%Y_%m_%d --date='1 days ago'`"_00_00_00.log"

# login to remote server and upload
ftp -n -i $SERVER <<EOF
user $USERNAME $PASSWORD
cd $REMOTEDIRECTORY
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
d>Kevin Lange1-4/+4 2011-12-03Fix string literal warningKevin Lange1-1/+1 2011-12-03Make the eyes uniformKevin Lange1-24/+24 2011-12-03Use the flat mouthKevin Lange1-24/+24 2011-12-02Added include for signal.hMyles Borins1-0/+1 2011-12-02Added SIGINT_handler to re-initialize cursor for reset on non-sane terminal ↵Myles Borins1-1/+6 emulators 2011-12-01Fixed some issues with animation.Aaron Peschel1-33/+33 Conflicts: src/nyancat.c 2011-12-01nyancat.c: Fix up sprinkles.Corbin Simpson1-24/+24 In the top left and top right, a pair of sprinkles were occasionally missing; they are now always present. In the bottom left, a corner of the poptart was occasionally frosted instead of cookie; it is now always cookie to match the other corners. In the bottom left, a sprinkle was occilating between two locations; it was moved to the more correct location on the right. 2011-12-01Update READMEKevin Lange1-2/+2 2011-12-01People won't have that, let's not scare them with an error messageKevin Lange1-1/+1 2011-12-01make that executableKevin Lange1-0/+0 2011-12-01Update everythingKevin Lange7-9/+105 2011-12-01Fixed fallback support to use bright foregrounds. Looks a lot betterKevin Lange1-16/+19 2011-12-01Add license header to c sourceKevin Lange1-1/+28 2011-12-01Fix MakefileKevin Lange1-1/+1 2011-11-30Made project more in line with Autotools standard.Aaron Peschel5-2/+50 2011-11-30Make some changes to the server to make it easier to closeKevin Lange1-2/+11 2011-11-30More readme updatesKevin Lange1-0/+6 2011-11-30Update readmeKevin Lange1-0/+16 2011-11-30That's a layover from the ToaruOS version of this...Kevin Lange1-1/+0 2011-11-30rxvt should emulate linuxKevin Lange1-1/+3 2011-11-30Buffer 1024 characters on each readKevin Lange1-1/+1 2011-11-30Hide the cursorKevin Lange1-1/+1 2011-11-30Telnet serverKevin Lange4-0/+808 2011-11-30Change description text for the modes. Standard color XTerm looks good, ↵Kevin Lange1-3/+3 linux+blink is actually the same, and standard ANSI is ugly as hell. 2011-11-30Will this work?Kevin Lange1-0/+2