File: cron.weekly

package info (click to toggle)
chrony 1.10-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,504 kB
  • ctags: 2,064
  • sloc: ansic: 15,081; sh: 152; makefile: 107
file content (21 lines) | stat: -rw-r--r-- 497 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
# Log rotation script for chrony John Hasler <jhasler@debian.org>
# This script is published under the same license as chrony.

set -e

[ -d /var/log/chrony/. ] || exit 0
[ -x /usr/sbin/chronyd ] || exit 0
umask 022
cd /var/log/chrony
[ "`ls -1A *.log`" ] || exit 0
for FILE in *.log
	do
  		savelog -c 7 $FILE > /dev/null
done
PASSWORD=`awk '$1 ~ /^1$/ {print $2; exit}' /etc/chrony/chrony.keys`
cat << EOF | /usr/bin/chronyc | sed '/^200 OK$/d'
password $PASSWORD
cyclelogs
EOF
exit 0