Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If there is a "0" in the project name, the script does not clear old reports. #253

Open
serg-kosyak opened this issue May 2, 2024 · 1 comment

Comments

@serg-kosyak
Copy link

serg-kosyak commented May 2, 2024

Hi @fescobar

CURRENT_SIZE=$(ls -Ad $PROJECT_REPORTS_DIRECTORY/* | grep -wv $PROJECT_REPORTS_DIRECTORY/latest | grep -wv 0 | grep -v $EMAILABLE_REPORT_FILE_NAME | wc -l)

If there is a "0" in the project name, the script does not clear old reports.
Screenshot 2024-05-02 121232

It looks like it's because of this: grep -wv 0
Here is result of command without this grep:
Screenshot 2024-05-02 122148

Here is result without flag --invert-match (-v): grep -w 0
image
As you can see, it filters all reports because of the Zero in the project name.

@serg-kosyak
Copy link
Author

@fescobar It might be better to go into the project folder first and then clean up. (look to my pull request)
I mean
cd $STATIC_CONTENT_PROJECTS/$PROJECT_ID/
and then
CURRENT_SIZE=$(ls -Ad reports/* | grep -wv reports/latest | grep -wv 0 | grep -v $EMAILABLE_REPORT_FILE_NAME | wc -l)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant