Sponsored Content
Top Forums Shell Programming and Scripting Expect script to collect logs in expert mode Post 303003242 by rovf on Monday 11th of September 2017 02:42:18 AM
Old 09-11-2017
If it waits for the full 30 minutes, it means that expect does not see the string you are waiting for.

You are writing
Code:
expect -exact "(.*)## $"

which means that you are waiting for the string "(.*)## $" to appear somewhere. I don't think this is what you want to achieve.

You can use exact, if you know the exact sequence of characters. In your case, it seems to me more natural do do an anchored regular expression matching, to cope for variations in, say, whitespace, for example

Code:
exact -re {^.+@.+ *## *[$] *$}

Please see it only as a suggestion to start with. I don't know what's in your output in general, and you have to judge by yourself, how to write the regexp so that you don't accidentally catch a line in your logs which looks the same.
This User Gave Thanks to rovf For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

strange expect script behavior, or am i misunderstanding expect scripting?

Hello to all...this is my first post (so please go easy). :) I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
Discussion started by: v1k0d3n
2 Replies

2. Shell Programming and Scripting

Need help with Expect script for Cisco IPS Sensors, Expect sleep and quoting

This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
Discussion started by: genewolfe
1 Replies

3. Shell Programming and Scripting

script to collect all db information

hi all I am looking for shell script ,by which i need to gather all the DB information in Sybase server . Thanks in advance :) (3 Replies)
Discussion started by: mvsramarao
3 Replies

4. Shell Programming and Scripting

Expect command use for interactive mode of scripting

Hi All, I am writing a script(Auto_Installation.sh) which is calling one another script (./update_manager /spare/install/HO7/PME_Response_file.txt) Now the issue is result of (./update_manager /spare/install/HO7/PME_Response_file.txt) script is ##########################################... (6 Replies)
Discussion started by: Dhruvak
6 Replies

5. Red Hat

collect red hat linux error logs

Hi, I have two questions,first of all is where can I collect more error logs(the log under /var/log/messages), also give the corresponding explain is grateful.The second one is the log under various versions(such as red hat,suse,etc) is the same or not. Thanks for answers. (1 Reply)
Discussion started by: zhaoyy
1 Replies

6. Shell Programming and Scripting

How to collect the logs with in two time stamp ?

Hi Gurus I need to collect the logs between two time stamp... The log files 12 hours format (ex- Nov 14, 2013 12:10:16 AM UTC) I tried the below commands but no luck. awk '$0 >= "Nov 14, 2013 9:40:01" && $0 <= "Nov 14, 2013 9:55:01"' file sed -n '/Nov 14, 2013 7:58:00 PM UTC/,/Nov 14, 2013... (5 Replies)
Discussion started by: zenkarthi
5 Replies

7. Shell Programming and Scripting

Expect doesn't output the logs

(qemu) migrate -d tcp:192.168.122.1:4444 (qemu) info migrate capabilities: xbzrle: off Migration status: completed total time: 4425 milliseconds downtime: 3 milliseconds transferred ram: 130338 kbytes remaining ram: 0 kbytes total ram: 1057152 kbytes duplicate: 232613 pages normal:... (0 Replies)
Discussion started by: yanglei_fage
0 Replies

8. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies

9. UNIX for Beginners Questions & Answers

How to set file transfer in binary mode in SFTP using Expect?

The below is my script. /usr/bin/expect<<EOD spawn /usr/bin/sftp -o Port=$PORT $USER@$HOST expect "sftp>" expect "password:" set timout 15 send "$password\r" expect "sftp>" send "lcd $remotedir\r" expect "sftp>" ... (1 Reply)
Discussion started by: Anilsaggu9
1 Replies
BRCTL(1)						    BSD General Commands Manual 						  BRCTL(1)

NAME
brctl -- Manage the CloudDocs daemon SYNOPSIS
brctl <command> [command-options and arguments] DESCRIPTION
brctl understands the following commands: diagnose [options] [<diagnosis-output-path>] diagnose and collect logs -M,--collect-mobile-documents[=<container>] (default: all containers) -s,--sysdiagnose Do not collect what's already part of sysdiagnose -n,--name=<name> Change the device name [<diagnosis-output-path>] Specifies the output path of the diagnosis; -n becomes useless. download <path> download a local copy of the document at this path evict <path> evict the local copy of the document at this path log [options] [<command>] -c,--color[={yes,no}] turn on or off color use -d,--path=<logs-dir> use <logs-dir> instead of default -H,--home=<home-dir> use this as the ~ prefix, to look for ~/L/ -f,--filter=<predicate> only show lines matching predicate -m,--multiline[={yes,no}] turn on or off multiple line logging -n=<number> number of initial lines to display -p,--page use paging -w,--wait wait for new logs continuously (syslog -w) -t,--shorten Shorten UUIDs, paths, etc -s,--digest Only print digest logs dump [options] [<container>] dump the CloudDocs database -o,--output=<file-path> redirect output to <file-path> -d,--database-path=<db-path> Use the database at <db-path> [<container>] the container to be dumped monitor [options] <container> use NSMetadataQuery to monitor the container -S,--scope=<scope> restrict the NSMDQ scope to DOCS, DATA, or BOTH versions [options] <path> [ALL|etags...] list the non-local versions of the document at this path. -a,--all List all non-local versions including those that are locally cached SEE ALSO
bird(8) Mac OS May 31, 2019 Mac OS
All times are GMT -4. The time now is 12:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy