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
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)
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)
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)
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)
#!/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)
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)
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
LEARN ABOUT MOJAVE
csdiagnose
csdiagnose(1) BSD General Commands Manual csdiagnose(1)NAME
csdiagnose -- collect information needed to diagnose CoreStorage volumes
SYNOPSIS
csdiagnose [-f path] [-h] [-v] [dev ...]
DESCRIPTION
csdiagnose collects information to help Apple investigate issues related to CoreStorage (File Vault 2, Fusion Drive, File Vault Everywhere,
etc). This tool invokes sudo, so you will be asked to authenticate.
This script requires csgather(1) to be installed in the PATH.
If dev is not given, all disks in the system will be inspected. This is the recommended method of invoking csdiagnose.
Advanced users can provide a list of dev in the form of disk1 or disk1s2. Only information of the given dev is collected. To fully collect
information of a CoreStorage volume, the CoreStorage Physical Volume (i.e., the Apple_CoreStorage partition), the Apple_Boot partition after
the physical volume, and the Logical Volume published by CoreStorage (which can be found out using the "diskutil cs list" command) should all
be provided on the command line.
The following information is collected:
1. OS version.
2. system logs, kernel logs, install logs, filesystem logs, and other useful information for CoreStorage debugging from /var/log.
3. output of "diskutil list".
4. output of "diskutil cs list".
5. output of "mount -t hfs".
6. "csgather -G" of every Apple_CoreStorage partition, which includes the CoreStorage metadata. If a list of dev is provided, only
information on the partitions included in the list will be collected.
7. EncryptedRoot.plist of every Apple_Boot partition. If a list of dev is provided, only information on the partitions included in
the list will be collected.
8. timestamps of the files relevant to kextcache/kextd.
The following user information is contained in the collected file:
1. Number and types of disks attached to the system.
2. The volume names, UUIDs, and size of each partition.
3. Encrypted versions of the volume key(s) that unlock the encrypted disk(s) attached to the system. Refer to csgather(1) for what
information could leak from the volume key(s).
4. User names, pictures, and password hints for the users.
No other user information (such as directory structures, file names, file content, etc) is collected.
The following options are available:
-h Show this help information.
-f path Specify an output path which will hold the file generated by this script. By default this will be the user's Desktop folder. The
given path must already exist.
-v Verbose mode, which prints every command it invokes.
SEE ALSO csgather(1), sysdiagnose(1)HISTORY
The csdiagnose utility first appeared along with CoreStorage in OS X 10.10.0.
OS X May 31, 2019 OS X