Skip to content

Commit

Permalink
More flexible match on filename from logrotate
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalinas committed Apr 26, 2017
1 parent c4afcf0 commit 3494410
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SingularityExecutor/src/main/resources/logrotate.conf.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ notifempty
NOW="$(($(date +%s%N)/1000000))"
LOGSTART=`getfattr --only-values -n user.logstart {{{ logfile }}}`
timestring=`date +%Y-%m-%d-%s`
for filename in "{{{ taskDirectory }}}/{{{ rotateDirectory }}}/{{{ logfileName }}}-${timestring%??}"*
for filename in "{{{ taskDirectory }}}/{{{ rotateDirectory }}}/{{{ logfileName }}}-${timestring%???}"*
do
setfattr -n user.logend -v "$NOW" $filename
if [ "$LOGSTART" != "" ]; then
Expand All @@ -45,7 +45,7 @@ notifempty
do
LOGSTART=`getfattr --only-values -n user.logstart $oldfile`
timestring=`date +%Y-%m-%d-%s`
for filename in "$oldfile-${timestring%??}"*
for filename in "$oldfile-${timestring%???}"*
do
if [ "$LOGSTART" != "" ]; then
setfattr -n user.logstart -v "$LOGSTART" $filename
Expand Down

1 comment on commit 3494410

@matush-v
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

Please sign in to comment.