[pretest] remove older logs from /var/log/ for better log_analyzer analysis#3670
Merged
vaibhavhd merged 2 commits intosonic-net:masterfrom Jul 14, 2021
Merged
[pretest] remove older logs from /var/log/ for better log_analyzer analysis#3670vaibhavhd merged 2 commits intosonic-net:masterfrom
vaibhavhd merged 2 commits intosonic-net:masterfrom
Conversation
wangxin
requested changes
Jul 7, 2021
Collaborator
wangxin
left a comment
There was a problem hiding this comment.
Manually run the command got error:
admin@vlab-01:~$ sudo find /var/log/ -mtime +1 '*.gz' | sudo xargs rm -f
find: paths must precede expression: `*.gz'
Can you check?
Contributor
Author
Fixed now, thanks! There indeed was an error that likely was masked by |
wangxin
approved these changes
Jul 14, 2021
vmittal-msft
pushed a commit
to vmittal-msft/sonic-mgmt
that referenced
this pull request
Sep 28, 2021
…alysis (sonic-net#3670) Remove more than one day logs from /var/log dir inside DUT. Before tests, some DUTs can have much older files which are not removed as part of present cleanup steps. These files lead to issues with log_analyzer processing. Added an extra step for files cleanup as part of test_pretest::test_cleanup_testbed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary: Remove more than one day logs from /var/log dir inside DUT.
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
Before tests, some DUTs can have much older files which are not removed as part of present cleanup steps.
These files lead to issues with log_analyzer processing. Examples include backup files and user created debug files:
/var/log/swss/sairedis.rec.1.gz-2021031300.backupHow did you do it?
Added an extra step for files cleanup as part of test_pretest::test_cleanup_testbed
How did you verify/test it?
With modification, the backup and older files are removed from /var/log dir
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation