~ubuntu-branches/debian/squeeze/ntp/squeeze-201010051545

« back to all changes in this revision

Viewing changes to debian/ntp-refclock.cron.daily

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-10-11 16:10:27 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041011161027-icyjbji8ujym633o
Tags: 1:4.2.0a-10ubuntu2
Use ntp.ubuntulinux.org instead of pool.ntp.org

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
# the default Debian ntp.conf enables logging of various statistics to the
4
 
# /var/log/ntpstats directory.  the daemon automatically changes to a new
5
 
# datestamped set of files at midnight, so all we need to do is delete old
6
 
# ones, and compress the ones we're keeping so disk usage is controlled
7
 
 
8
 
if [ -d /var/log/ntpstats ]
9
 
then
10
 
        # only keep a week's depth of these
11
 
        find /var/log/ntpstats -type f -mtime +7 -exec rm {} \;
12
 
 
13
 
        # compress whatever is left to save space
14
 
        cd /var/log/ntpstats 
15
 
        ls loopstats.???????? peerstats.???????? > /dev/null 2>&1
16
 
        if [ $? = 0 ]
17
 
        then
18
 
 
19
 
                # note that gzip won't actually compress the filenames that 
20
 
                # are actually hard links to the live/current files... so this
21
 
                # compresses yesterday and previous, leaving the live log alone
22
 
                # -- we supress the warnings gzip issues about not compressing
23
 
                # the linked file, which is why this isn't a one-liner
24
 
 
25
 
                gzip --best --quiet loopstats.???????? peerstats.???????? 
26
 
                return=$?
27
 
                case $return in 
28
 
                2)      exit 0                  # Squash all warnings
29
 
                        ;;
30
 
                *)      exit $return            # but let real errors through
31
 
                        ;;
32
 
                esac
33
 
        fi
34
 
fi
35