-
Notifications
You must be signed in to change notification settings - Fork 226
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
🧹 fix+refact(system-cleanup) #856
🧹 fix+refact(system-cleanup) #856
Conversation
if [ -d /var/tmp ]; then | ||
"$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete | ||
fi | ||
if [ -d /tmp ]; then | ||
"$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete | ||
fi | ||
if [ -d /var/log ]; then | ||
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \; | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do something like this ? This will not return non zero if the dir is not found
if [ -d /var/tmp ]; then | |
"$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete | |
fi | |
if [ -d /tmp ]; then | |
"$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete | |
fi | |
if [ -d /var/log ]; then | |
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \; | |
fi | |
"$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete &> /dev/null || true | |
"$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete &> /dev/null || true | |
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \; &> /dev/null || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could but if user doesnt have perms for a file (could happen and will happen with /tmp) it'll fail too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cmd is escalated so is less likely to fail due to perm err
Type of Change
Testing
Works :)
Issues / other PRs related
Checklist