Lines Matching +full:directory +full:- +full:based

14         -n, —-name <name>     Name to be used for the archive.
16 -d, —-dir <directory> Archive directory to copy the compressed report.
17 Default output directory is /tmp
18 -i, —-id <id> Dump identifier to associate with the archive.
21 -t, —-type <type> Data collection type. Valid types are
24 -p, —-path <path> Optional contents to be included in the archive.
25 Valid paths are absolute file path or d-bus path
26 based on type parameter.
27 -Absolute file path for "core" type.
28 -elog d-bus object for "elog" type.
29 -s, --size <size> Maximum allowed size(in KB) of the archive.
32 -v, —-verbose Increase logging verbosity.
33 -q, —-quiet Only log fatal errors to stderr
34 -h, —-help Display this help and exit.
39 declare -rx TRUE=1
40 declare -rx FALSE=0
41 declare -rx UNLIMITED="unlimited"
42 declare -rx SUMMARY_DUMP="summary"
43 declare -rx TYPE_USER="user"
44 declare -rx TYPE_CORE="core"
45 declare -rx TYPE_ELOG="elog"
46 declare -rx TYPE_CHECKSTOP="checkstop"
47 declare -rx TYPE_RAMOOPS="ramoops"
48 declare -rx SUMMARY_LOG="summary.log"
49 declare -rx DREPORT_LOG="dreport.log"
50 declare -rx TMP_DIR="/tmp"
51 declare -rx EPOCHTIME=$(date +"%s")
52 declare -rx TIME_STAMP="date -u"
53 declare -rx PLUGIN="pl_"
54 declare -rx DREPORT_SOURCE="/usr/share/dreport.d"
55 declare -rx DREPORT_INCLUDE="$DREPORT_SOURCE/include.d"
56 declare -rx ZERO="0"
57 declare -rx JOURNAL_LINE_LIMIT="500"
58 declare -rx HEADER_EXTENSION="$DREPORT_INCLUDE/gendumpheader"
61 declare -rx SUCCESS="0"
62 declare -rx INTERNAL_FAILURE="1"
63 declare -rx RESOURCE_UNAVAILABLE="2"
66 declare -x name=""
67 declare -x dump_dir="/tmp"
68 declare -x dump_id="00000000"
69 declare -x dump_type=$TYPE_USER
70 declare -x verbose=$FALSE
71 declare -x quiet=$FALSE
72 declare -x dump_size="unlimited"
73 declare -x name_dir=""
74 declare -x optional_path=""
75 declare -x dreport_log=""
76 declare -x summary_log=""
77 declare -x cur_dump_size=0
78 declare -x pid=$ZERO
79 declare -x elog_id=""
84 # @brief Initiate data collection based on the type.
121 # check plugin directory for this dump type?
122 if [ ! -d $plugin_path ]; then
127 #Executes plugins based on the type.
135 # As per coredump source code systemd-coredump uses below format
144 #matching systemd-coredump core file format.
145 pid=$(echo $file | awk -F . '{ print $5}')
148 # @brief set elog pid by reading _PID information from the elog d-bus object.
153 additional_data=$(busctl get-property xyz.openbmc_project.Logging \
159 if [ ! -z "$additional_data" ]; then
161 awk -F _PID= '{ print ($2+0)}')
175 # variables. Create directory for temporary data collection
181 if [ -z $name ]; then
185 #Create temporary data directory.
186 mkdir -p "$TMP_DIR/$name"
187 if [ $? -ne 0 ]; then
188 echo "Error: Failed to create the temporary directory."
192 #name directory
207 log_error "Invalid -type, Only summary log is available"
213 if [ "$dump_size" -eq "$dump_size" ] 2>/dev/null; then
226 mkdir -p "$dump_dir"
227 if [ $? -ne 0 ]; then
228 log_error "Could not create the destination directory $dump_dir"
233 if [ -f "$HEADER_EXTENSION" ]; then
234 tar -Jcf "$name_dir.tar.xz" -C \
238 cat "$name_dir.tar.xz" | tee -a "/tmp/dumpheader_$EPOCHTIME" > /dev/null
241 tar -Jcf "$name_dir.tar.xz" -C \
245 if [ $? -ne 0 ]; then
247 rm -r "$name_dir"
251 #remove the temporary name specific directory
252 rm -r "$name_dir"
262 if [ $? -ne 0 ]; then
279 if [[ ${result} -ne $SUCCESS ]]; then
287 #collect data based on the type.
292 if [[ ${result} -ne $SUCCESS ]]; then
300 TEMP=`getopt -o n:d:i:t:s:p:vqh \
301 --long name:,dir:,dumpid:,type:,size:,path:,verbose,quiet,help \
302 -- "$@"`
304 if [ $? -ne 0 ]
310 eval set -- "$TEMP"
312 while [[ $# -gt 1 ]]; do
315 -n|--name)
318 -d|--dir)
321 -i|--dumpid)
324 -t|--type)
327 -s|--size)
330 -p|--path)
333 -v|--verbose)
336 -q|--quiet)
339 -h|--help)