Deployment and Imaging Group

 View Only

Script to Copy Logs From Linux Client 

Sep 26, 2012 12:50 PM

This script can be used in jobs if task log are require to be copied at some central location & then looked at later.  

I have used %SERIALNUMBER% taken to uniquely identify client machines. User may opt to have additional tokens to make machine names unique.

Also user can modify it to capture specific logs.

Usage:

1. Create a Job that has 'prepare for Image capture' 'create image' & 'boot to production task'
2. Script task having code below can be sequenced after 'create image' task.
 

A folder will be created at shared location & log will be copied in that. Folder format is as below:

 %SERIALNUMBER%_ddMMMyyyy_hhmmss_taskstatus_taskname

##Script##

mkdir /mnt/shr
mount -t cifs //<IP>/Shared /mnt/shr -o username=<user>,password=<password>
test=`date "+_%d%b%Y_%H_%M_%S"`
test=`echo %SERIALNUMBER%$test`
test1=`aex-cta list | tail -n 2 | head -n 1 | awk '{print $3}'`
test2=`aex-cta list | tail -n 2 | head -n 1 | awk '{print $4}'`
pad='_'
test1=`echo $test1$pad$test2`
test=`echo $test$pad$test1`
mkdir /mnt/shr/Logs/$test
cp -r /opt/altiris/notification/nsagent/var/*log /mnt/shr/Logs/$test

Statistics
0 Favorited
0 Views
1 Files
0 Shares
0 Downloads
Attachment(s)
txt file
Script_to_copy_logs_from_Linux_client.txt   453 B   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Related Entries and Links

No Related Resource entered.