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):
-
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
-
root% tar -zcvf varlog-mem0.tar.gz /var/log/
-
root% ls
Note: You should see the ' varlog-0.tar.gz file generated here.
-
root% mv varlog-mem0.tar.gz /var/tmp/
-
root% exit
Note: This will bring you to the CLI '>' prompt of Master switch )
-
root> request session member 1
Note: This connects you to member 1 of the VC.
-
root> start shell user root
-
root% tar -zcvf varlog-mem1.tar.gz /var/log/
-
root% ls
Note: This will generate varlog-mem1.tar.gz in /root/ directory on backup)
-
root% mv varlog-mem1.tar.gz /var/tmp/
-
root% exit
-
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.
-
root> request session member 2
-
root> start shell user root
-
root% tar -zcvf varlog-mem2.tar.gz /var/log/
-
root% ls
Note: This will generate varlog-mem2.tar.gz in /root/ directory
-
root% mv varlog-mem2.tar.gz /var/tmp/
-
root% exit
-
root> file copy fpc2:/var/tmp/varlog-mem2.tar.gz fpc0:/var/tmp/
-
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.