FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 4th, 2002, 01:28 PM
mreyes mreyes is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 11 mreyes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question FTP file transfer problem with "\n" fordatabase replication

Hi,

I'm working on some scripts to replicate a mysql data base from one local server to a remote server. I'm using FTP to transfert a text file with the last queries, so i can execute those queries in the remote server.
Some times it work, sometimes it does'nt. I think that the problem is that I use the \n character to break the lines( separate the queries?) in the local text files, but in the remote server instead of breaking the lines there is a little square that appears in the file created by the ftp transfert.

Can any one help me?

Reply With Quote
  #2  
Old December 4th, 2002, 02:49 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
It's most likely due to the fact that UNIX/Linux uses "\n" to terminate a line, whilst Windows uses "\r\n" to terminate a line. If it just sees "\n" it can't deal with it, so it sometimes prints the box you're seeing. The solution is to copy the files directly from one server to the other (using scp), or possibly transferring the file using a Windows box but enabling the "binary" option in file transfer mode (not sure if this will stop Windows arbitrating over the file contents, but it might).


Hope this helps.
__________________
Alex
(http://www.alex-greg.com)

Reply With Quote
  #3  
Old December 4th, 2002, 03:49 PM
mreyes mreyes is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 11 mreyes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This seems to fix the problem of the line ending,thanks!
By the way I'm doing the testing beetween two windows servers, but the implementation will be done between a windows and a linux server.
I'm testing this replication system, if it doesn't work, I'm going to read more about the mysql replications options...
Thanks again.

Last edited by mreyes : December 4th, 2002 at 03:53 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > FTP file transfer problem with "\n" fordatabase replication


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway