Skip to content

Commit

Permalink
[generate_dump] Ignoring file/directory not found Errors (sonic-net#1201
Browse files Browse the repository at this point in the history
)

Added checks to ignore files/directories that are not present while generating the dump.

Signed-off-by: Sabareesh Kumar Anandan <[email protected]>
  • Loading branch information
Sabareesh-Kumar-Anandan authored Nov 20, 2020
1 parent be834be commit b445364
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ save_redis_info() {
save_proc() {
local procfiles="$@"
$MKDIR $V -p $TARDIR/proc \
&& $CP $V -r $procfiles $TARDIR/proc \
&& (for f in $procfiles; do ( [ -e $f ] && $CP $V -r $f $TARDIR/proc ) || echo "$f not found" > $TARDIR/$f; done) \
&& $TAR $V -rhf $TARFILE -C $DUMPDIR --mode=+rw $BASE/proc \
&& $RM $V -rf $TARDIR/proc
}
Expand Down Expand Up @@ -615,7 +615,7 @@ save_crash_files() {
done

# archive kernel dump files
for file in $(find_files "/var/crash/"); do
[ -d /var/crash/ ] && for file in $(find_files "/var/crash/"); do
# don't gzip already-gzipped dmesg files :)
if [ ! ${file} = "/var/crash/kexec_cmd" -a ! ${file} = "/var/crash/export" ]; then
if [[ ${file} == *"kdump."* ]]; then
Expand Down

0 comments on commit b445364

Please sign in to comment.