Junos
Junos

SAVE to FTP Server - ASCII vs Binary (LF vs CRLF)

05.10.11   |  
‎05-10-2011 01:37 PM

When I try to save JUNOS CLI output to an FTP server running on my Windows 7 machine all of the line breaks are missing when I view the file in MS Notepad.  My research seems to point to two solutions:

 

1) Use a differnet text editor that supports both CRLF (MS OS) and LF (Unix-based OS)

 

2) Transfer your files in "ASCII" mode from the FTP client.

 

Does anyone know how to transfer via FTP in "ASCII" mode on the JUNOS platform?

 

I'm running:

JUNOS 10.3R3.7 on an SRX210

and

FileZilla FTP Server v0.9.37 beta and MS Notepad on Windows 7 SP1

 

The command I'm running is:

show | compare | no-more | save ftp://user:pass@10.0.1.2/srxchanges.txt

 

Has anyone encountered this and come up with a workaround?  Thank you.

 

4 REPLIES
Junos
Solution
Accepted by topic author adamjguy
‎08-26-2015 01:27 AM

Re: SAVE to FTP Server - ASCII vs Binary (LF vs CRLF)

05.10.11   |  
‎05-10-2011 01:54 PM

Not sure you can change the option when doing a save from within the CLI. One solution would be to just save the file locally, drop out to the shell (start shell) and then do a regular ftp from the UNIX command line where you can directly control the ftp options.

Kevin Barker
JNCIP-SEC
JNCIS-ENT, FWV, SSL, WLAN
JNCIA-ER, EX, IDP, UAC, WX
Juniper Networks Certified Instructor
Juniper Networks Ambassador

Juniper Elite Reseller
J-Partner Service Specialist - Implementation

If this worked for you please flag my post as an "Accepted Solution" so others can benefit. A kudo would be cool if you think I earned it.
Highlighted
Junos

Re: SAVE to FTP Server - ASCII vs Binary (LF vs CRLF)

05.10.11   |  
‎05-10-2011 03:08 PM

use Gnu Emacs on windows - it will change your life Smiley Happy (plus it acts like Junos CLI...or is it the other way around...)

Junos

Re: SAVE to FTP Server - ASCII vs Binary (LF vs CRLF)

[ Edited ]
05.10.11   |  
‎05-10-2011 04:23 PM

Or just use WordPad (built in to Windows), Notepad++ (freeware), UltraEdit (payware), etc.

 

If you don't want to learn a new text editor, you could also use unix2dos to convert the unix files to dos format (the format you're probably used to).

Junos

Re: SAVE to FTP Server - ASCII vs Binary (LF vs CRLF)

05.11.11   |  
‎05-11-2011 11:42 AM

Initiating the FTP connection from the shell instead of the CLI seemed to do the trick.  Thanks for the suggestion.