File: cron.daily

package info (click to toggle)
remote-tty 4.0-13
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 212 kB
  • ctags: 219
  • sloc: ansic: 2,100; sh: 340; makefile: 131
file content (19 lines) | stat: -rw-r--r-- 447 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
#
# Rotate remote-tty log files daily, but only if they've had something
# written to them.
#

# Check our device configuration directory actually exists.
if [ ! -d /etc/remote-tty/dev ]; then
	exit 0
fi

cd /etc/remote-tty/dev
for tty in *; do
	if [ -s /var/log/remote-tty/$tty/$tty ]; then
		savelog -t -u rttymgr -g rttymgr -m 644 \
			/var/log/remote-tty/$tty/$tty > /dev/null
		kill -HUP `cat /var/run/remote-tty/pid/$tty`
	fi
done