Junos
Reply
Contributor
adamjguy
Posts: 13
Registered: ‎03-15-2011
0
Accepted Solution

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

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.

 

Distinguished Expert
muttbarker
Posts: 2,372
Registered: ‎01-29-2008

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

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.
Trusted Expert
Automate
Posts: 784
Registered: ‎11-01-2007
0

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

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

Visitor
whodat
Posts: 1
Registered: ‎10-14-2010
0

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

[ Edited ]

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).

Contributor
adamjguy
Posts: 13
Registered: ‎03-15-2011
0

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

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

Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.