Sponsored Content
Operating Systems OS X (Apple) How can I direct messages from mac console.app to a log file? Post 303043906 by dallas88 on Monday 10th of February 2020 07:17:16 PM
Old 02-10-2020
This might not the best method but I used the Log show command to access the unified logs.
And then directed this to a file. So I use this to monitor the camera status.

Code:
#!/bin/bash
# Detects the status of the Apple Camera (Facetime).
Camstatus=$(log show --last 15m | grep 'AppleCamIn::')
echo "$Camstatus" >>~/library/logs/camera.log


I found out I can also can also run this command to collect the log info.
sudo log collect --output ~/Documents/logcoll.logarchive --start '2020-02-10'
(softron
HOW TO: Collect system logs on macOS Sierra and later – Softron Support Desk

I saw this post from @jollyRoger on the command to open the .logarchive formatted file.
Unified Logs | macOS High Sierra - Ask Different

Sorry I forgot to post back my gratitude for this great forum. Thanks Neo
Thanks, Ron -- still learning.
This User Gave Thanks to dallas88 For This Post:
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Re-direct the error msg to log file

Hi All, I have an expression as follows:- a=`expr ${i} + ${j}` >> $log_file 2>&1 Here, if any of the values i or j or both happens to be empty then the "expr" returns error as "expr: 0402-050 Syntax error." My problem is I am not able to re-direct this error to the log file. Its is getting... (4 Replies)
Discussion started by: rony_daniel
4 Replies

2. Shell Programming and Scripting

Direct the output of a script to a log file

Hi, I have a script to compare 2 files. file1=$1 file2=$2 num_of_records_file1=`awk ' END { print NR } ' $file1` num_of_records_file2=`awk ' END { print NR } ' $file2` i=1 while do sed -n "$i"p $file1 > file1_temp sed -n "$i"p $file2 > file2_temp diff file1_temp... (5 Replies)
Discussion started by: autosys_nm
5 Replies

3. Shell Programming and Scripting

Set default app for file type on Mac

Hi there, We have 2 apps on our customers machines that can both open files with the same file extension. Is there any way via shell commands to set which application should be the default? Essentially, I'm hoping to replicate Get Info > Open With > Change All using a shell script, but I just... (0 Replies)
Discussion started by: davewg
0 Replies

4. Shell Programming and Scripting

Need Mac .sh to run command line app in seperate terminal

Hello, currently we are executing a .sh from terminal. The current .sh looks like this: #!/usr/bin/env bash /Users/user/my.app/Contents/MacOS/my & -- Now, we also need to run a third line in the .sh - It's a command line application that I need to run when I execute the above .sh... (0 Replies)
Discussion started by: yoyoyo777
0 Replies

5. UNIX for Dummies Questions & Answers

re-direct to log file

#!/bin/ksh -x cd /tmp/tj ftp -n servername.com << DONE user username password as put test.log quit close DONE echo "testing..." sh -x scriptname, and it shows all, but username, as, put, quit, close, DONE. how can i see those ? (1 Reply)
Discussion started by: tjmannonline
1 Replies

6. Shell Programming and Scripting

Manipulating sed Direct Input to Direct Output

Hi guys, been scratching round the forums and my mountain of resources. Maybe I havn't read deep enough My question is not how sed edits a stream and outputs it to a file, rather something like this below: I have a .txt with some text in it :rolleyes: abc:123:xyz 123:abc:987... (7 Replies)
Discussion started by: the0nion
7 Replies

7. Cybersecurity

Best practice to allow 3rd party app to read messages file.

What is the best practice to allow a 3rd party health monitoring app to read the messages file. Since messages is a system file and is owned by root the app cannot read the file. I don't want to run the app as root so how should I allow the app to read the file. The read function is actually built... (2 Replies)
Discussion started by: slwiley
2 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:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy