Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[EX] How to copy the entire contents of /var/log from an EX switch including all members of a VC configuration



Article ID: KB15400 KB Last Updated: 10 Aug 2020Version: 2.0

This article provides a procedure for copying the entire contents of the /var/log directory into a single file, and then copying it from an EX Switch.

This procedure includes the EX switch virtual chassis (VC) configuration, which requires that the /var/log directory should be copied from each member of the virtual chassis.



Note: The procedure listed below is for tar'ring and compressing all files in the /var/log directory of an EX switch in a Virtual Chassis (VC). This can be done on any EX switch to copy the entire contents of the /var/log directory from the Routing Engine.

Topology: Three Member Virtual Chassis (VC)

Procedure to tar and copy the /var/log/ directory from each member of a Virtual Chassis (VC):

  1. Log on to the Master EX switch and start shell (if you have logged in as root, you will be logged into shell):

User switch> start shell user root 
  1. root% tar -zcvf varlog-mem0.tar.gz /var/log/
  2. root% ls

Note: You should see the ' varlog-0.tar.gz file generated here.

  1. root% mv varlog-mem0.tar.gz /var/tmp/
  2. root% exit

Note: This will bring you to the CLI '>' prompt of Master switch )

  1. root> request session member 1

Note: This connects you to member 1 of the VC.

  1. root> start shell user root
  2. root% tar -zcvf varlog-mem1.tar.gz /var/log/
  3. root% ls

Note: This will generate varlog-mem1.tar.gz in /root/ directory on backup)

  1. root% mv varlog-mem1.tar.gz /var/tmp/
  2. root% exit
  3. root> file copy fpc1:/var/tmp/varlog-mem1.tar.gz fpc0:/var/tmp/

Note: Copy the member 1 tar file to the member 0 /var/tmp directory.

  1. root> request session member 2
  2. root> start shell user root
  3. root% tar -zcvf varlog-mem2.tar.gz /var/log/
  4. root% ls

Note: This will generate varlog-mem2.tar.gz in /root/ directory

  1. root% mv varlog-mem2.tar.gz /var/tmp/
  2. root% exit
  3. root> file copy fpc2:/var/tmp/varlog-mem2.tar.gz fpc0:/var/tmp/
  4. root> exit

You should be able to see all three log files that were generated and copied into the /var/tmp folder of the master FPC (FPC0).

  • varlog-mem0.tar.gz
  • varlog-mem1.tar.gz
  • varlog-mem2.tar.gz

You can now FTP these files from the EX Switch.


Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search