Wireless Sensor Networks
Stargate Developer’s Guide
Page 20
Doc. # 7430-0317-13 Rev. B
etc/xfer/etc/
etc/xfer/etc/PASSWORD
etc/xfer/etc/USERNAME
etc/xfer/do-file-xfer.sh
etc/init.d/xfer-driver.sh
2.
Edit the /etc/xfer/PASSWORD and /etc/xfer/USERNAME files and enter the appropriate
settings for the remote Linux server ftp access.
3.
Edit the /etc/xfer/do-file-xfer.sh file and make sure the REMOTE symbol is set to the name or IP
address of the remote ftp server. Make sure the TABLE symbol is set to the table name of the
table you wish to replicate – default is
surge_results
.
4.
Execute the /etc/init.d/xfer-driver.sh script to start the replication process. A successful output
looks like the following:
$ /etc/init.d/xfer-driver.sh
Last Date 05/20/05 12:26:31
COPY
230 Login successful. Have fun.
LOGIN WAS OK
226 File receive OK.
File Sent OK
Connected to 192.168.2.50.
220 (vsFTPd 1.1.3)
331 Please specify the password.
230 Login successful. Have fun.
Remote system type is UNIX.
Using binary mode to transfer files.
250 Directory successfully changed.
local: /tmp/mytable-2005-05-20-14-07.txt remote: tmp4008
227 Entering Passive Mode (192,168,2,50,56,228)
150 Ok to send data.
226 File receive OK.
38752 bytes sent in 0.02 secs (1858.3 kB/s)
350 Ready for RNTO.
250 Rename successful.
local: /tmp/test-script.sh remote: new-script.sh
227 Entering Passive Mode (192,168,2,50,230,215)
550 Failed to open file.
221 Goodbye.
Renamed Remote file
ALL OK!
XFER OK!! etc/xfer/
At the ftp server end of the connection (Linux host) you should see time-stamped .txt files being
created in the /tmp folder similar to the following:
$ ls /tmp/*.txt
/tmp/mytable-2005-05-20-12-26.txt /tmp/mytable-2005-05-20-14-00.txt
/tmp/mytable-2005-05-20-12-38.txt /tmp/mytable-2005-05-20-14-07.txt
Each time a file is created on the remote server the xfer-driver.sh script running on the Stargate will
sleep for 2 hours. This value can be changed by editing the xfer-driver.sh script and re-starting it.
Linux Host Configuration
The Linux host end of the replication scheme completes the database replication by taking the .txt
files uploaded to the /tmp folder and importing them into the locally running PostgreSQL database –
i.e. the
replica
.
Summary of Contents for Stargate
Page 1: ...Stargate Developer s Guide Rev B January 2006 Document 7430 0317 13 ...
Page 50: ......
Page 51: ......