Created
March 23, 2018 09:21
-
-
Save rooty/f991e110af0c7c168c5bba0b1accd779 to your computer and use it in GitHub Desktop.
Manipulate date
This file contains 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
/var/log/myproject/celery.log { | |
size 1 | |
su myuser myuser | |
copytruncate | |
create | |
rotate 10 | |
missingok | |
postrotate | |
timeext=`date -d '1 day ago' "+%Y-%m-%d"` # daily | |
# timeext=$(date +%Y-%m-%d_%H) # hourly | |
mv /var/log/myproject/celery.log.1 /var/log/myproject/archive/celery_$timeext.log | |
endscript | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment