#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Posts
    11
    Rep 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?
  2. #2
  3. Full Access
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jun 2000
    Location
    London, UK
    Posts
    2,019
    Rep Power
    17
    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)
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Posts
    11
    Rep 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.

IMN logo majestic logo threadwatch logo seochat tools logo