4 # ============LICENSE_START=======================================================
6 # ================================================================================
7 # Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
8 # ================================================================================
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
13 # http://www.apache.org/licenses/LICENSE-2.0
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
20 # ============LICENSE_END=========================================================
24 # migration_verification.sh -- This tool is used to provide a summary of migration logs
25 # This searches for pre-defined strings "Migration Error" and "Migration Summary Count" in log files and outputs those lines.
32 1. Usage: migration_verification.sh <last_modified> <logs_path>
33 2. The <logs_path> should be a directory containing all of the logs. If empty, default path is /opt/app/aai-graphadmin/logs/migration.
34 3. The <last_modified> parameter should be an integer for up to how many minutes ago a log file should be parsed.
35 4. Example: migration_verification.sh 60 /opt/app/aai-graphadmin/logs/migration
44 LOGS_DIRECTORY=${2:-/opt/app/aai-graphadmin/logs/migration/}
48 echo 'Running migration summary:'
49 print "Logs directory: $LOGS_DIRECTORY"
50 print "Searching log files modified within last $MTIME minutes: \n"
53 for i in $(find -L $LOGS_DIRECTORY -mtime -$MTIME -name '*.log' );
55 echo "Checking Log File: $i"
56 grep "Migration Error:" $i
57 grep "Migration Summary Count:" $i