Compare commits

..

No commits in common. "master" and "rewrite-2022-03-26" have entirely different histories.

3 changed files with 4 additions and 35 deletions

View File

@ -1,8 +0,0 @@
Copyright (c) Michael Holloway, 2022
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,21 +0,0 @@
mdlspipe
========
v0.1.1
Supported Platforms: Mac OS X
Provided a directory (default is current directory), capture particular
fields of `mdls` output for each file in provided directory in a csv.
Usage
-----
Run directly:
./mdlspipe
Place mdlspipe in your $PATH and run from $PWD.
By default, mdlspipe will write the output data to a csv called
'mdlspipe_YYYY-MM-DD_HH-MM-SS.csv'.

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
log_file=/var/log/mdlspipe.log
Working_Fullpath=$(pwd)
Working_Directory=$(basename $Working_Fullpath)
log_file=/var/log/hash-files.log
keys_of_interest=("kMDItemFSCreationDate" "kMDItemFSName")
md5_bin=$(which md5sum)
mktemp_bin=$(which mktemp)
@ -18,8 +16,8 @@ set +a
write_log () {
## Use on systems managed with systemd
# printf 'mdlspipe: %s\n' "$1" | systemd-cat
printf '%s mdlspipe: %s\n' "$DateTimeStamp" "$1" >> $log_file
# printf 'hash-files: %s\n' "$1" | systemd-cat
printf '%s hash-files: %s\n' "$DateTimeStamp" "$1" >> $log_file
}
@ -83,5 +81,5 @@ for file in $(find $Working_Fullpath -maxdepth 1 -type f); do
# write_per_file $file $hash $mdls_properties
done
} >> $temp_csv_file
cat $temp_csv_file
unset IFS
mv $temp_csv_file $PWD/mdlspipe_$(date +%\D_\%T|sed 's/[:|\/]/-/g').csv