-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtolocal.sh
More file actions
executable file
·36 lines (27 loc) · 864 Bytes
/
tolocal.sh
File metadata and controls
executable file
·36 lines (27 loc) · 864 Bytes
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
29
30
31
32
33
34
35
36
#!/bin/sh -vx
# Script to FTP data to server
# Paramters: host FTP Server
# user FTP Username
# passwd FTP Password
# file File to send/put
############################################################################
SDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CONF=$1
if [ -e $SDIR"/configuration.sh" ]; then
source $SDIR"/configuration.sh"
fi;
if [ ! -z $CONF ]; then
source $CONF # overwrite previous conf
fi;
x-www-browser "http://"$DS_URL"method=export&-dbid=0-code="$DS_CODE"-filename="$FILENAME
pause 'continue when ready';
ftp -nv <<EOF
open $FTP_HOST
user $FTP_USER $FTP_PASSWD
bin
get $REMOTEFILE $LOCALFILE
del $REMOTEFILE
quit
EOF
gunzip < $LOCALFILE | mysql -u $MYSQL_USER -p$MYSQL_PASS $MYSQL_DB;
pause 'completed'