diff options
author | pst <pst@FreeBSD.org> | 1997-08-16 17:04:02 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1997-08-16 17:04:02 +0000 |
commit | 1d67bc6abbb219a957bf68da4f8eb8e69058f0ba (patch) | |
tree | 564f5ee31ac28af72ffa391c4b9fdf67a5bedf7b /etc/periodic/daily | |
parent | 003551adee3fcf367794630d905a06997d9a1dfe (diff) | |
download | FreeBSD-src-1d67bc6abbb219a957bf68da4f8eb8e69058f0ba.zip FreeBSD-src-1d67bc6abbb219a957bf68da4f8eb8e69058f0ba.tar.gz |
Copy /etc/cron.d to /etc/periodic per-request of many.
This wasn't done with a repository copy because there was no
history of any consequence. Flames to me.
Diffstat (limited to 'etc/periodic/daily')
-rwxr-xr-x | etc/periodic/daily/100.clean-disks | 15 | ||||
-rwxr-xr-x | etc/periodic/daily/110.clean-tmps | 32 | ||||
-rwxr-xr-x | etc/periodic/daily/120.clean-preserve | 10 | ||||
-rwxr-xr-x | etc/periodic/daily/130.clean-msgs | 11 | ||||
-rwxr-xr-x | etc/periodic/daily/140.clean-rwho | 11 | ||||
-rwxr-xr-x | etc/periodic/daily/200.backup-passwd | 35 | ||||
-rwxr-xr-x | etc/periodic/daily/210.backup-aliases | 22 | ||||
-rwxr-xr-x | etc/periodic/daily/220.backup-distfile | 15 | ||||
-rwxr-xr-x | etc/periodic/daily/300.calendar | 17 | ||||
-rwxr-xr-x | etc/periodic/daily/310.accounting | 15 | ||||
-rwxr-xr-x | etc/periodic/daily/320.rdist | 10 | ||||
-rwxr-xr-x | etc/periodic/daily/330.news | 11 | ||||
-rwxr-xr-x | etc/periodic/daily/340.uucp | 13 | ||||
-rwxr-xr-x | etc/periodic/daily/400.status-disks | 14 | ||||
-rwxr-xr-x | etc/periodic/daily/410.status-uucp | 10 | ||||
-rwxr-xr-x | etc/periodic/daily/420.status-network | 10 | ||||
-rwxr-xr-x | etc/periodic/daily/430.status-rwho | 10 | ||||
-rwxr-xr-x | etc/periodic/daily/440.status-mailq | 10 | ||||
-rwxr-xr-x | etc/periodic/daily/450.status-security | 11 | ||||
-rwxr-xr-x | etc/periodic/daily/999.local | 13 | ||||
-rw-r--r-- | etc/periodic/daily/Makefile | 24 |
21 files changed, 319 insertions, 0 deletions
diff --git a/etc/periodic/daily/100.clean-disks b/etc/periodic/daily/100.clean-disks new file mode 100755 index 0000000..0df987d --- /dev/null +++ b/etc/periodic/daily/100.clean-disks @@ -0,0 +1,15 @@ +#!/bin/sh +# +# $Id: 100.clean-disks,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# +# This is a security hole, never use 'find' on a public directory +# with -exec rm -f as root. This can be exploited to delete any file +# on the system. +# + +exit 0 # do not run by default + +find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \ + \( -name '[#,]*' -o -name '.#*' -o -name a.out -o -name '*.core' \ + -o -name '*.CKP' -o -name '.emacs_[0-9]*' \) \ + -a -atime +3 -exec rm -f -- {} \; diff --git a/etc/periodic/daily/110.clean-tmps b/etc/periodic/daily/110.clean-tmps new file mode 100755 index 0000000..960c6aa --- /dev/null +++ b/etc/periodic/daily/110.clean-tmps @@ -0,0 +1,32 @@ +#!/bin/sh +# +# $Id: 110.clean-tmps,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# +# This is a security hole, never use 'find' on a public directory +# with -exec rm -f as root. This can be exploited to delete any file +# on the system. +# +# Use at your own risk, but for a long-living system, this might come +# more useful than the boot-time cleaning of /tmp. If /var/tmp and +# /tmp are symlinked together, only one of the below will actually +# run. +# + +exit 0 # do not run by default + +if [ -d /tmp ]; then + cd /tmp && { + find . -type f -atime +3 -ctime +3 ! -name '.X*-lock' \ + -exec rm -f -- {} \; + find -d . ! -name . -type d -mtime +1 -exec rmdir -- {} \; \ + >/dev/null 2>&1 + } +fi + +if [ -d /var/tmp ]; then + cd /var/tmp && { + find . ! -name . -atime +7 -ctime +3 -exec rm -f -- {} \; + find -d . ! -name . -type d -mtime +1 -exec rmdir -- {} \; \ + >/dev/null 2>&1 + } +fi diff --git a/etc/periodic/daily/120.clean-preserve b/etc/periodic/daily/120.clean-preserve new file mode 100755 index 0000000..a63ccc3 --- /dev/null +++ b/etc/periodic/daily/120.clean-preserve @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $Id: 120.clean-preserve,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# + +if [ -d /var/preserve ]; then + echo "" + echo "Removing stale files from /var/preserve:" + cd /var/preserve && find . ! -name . -mtime +7 -exec rm -f -- {} \; +fi diff --git a/etc/periodic/daily/130.clean-msgs b/etc/periodic/daily/130.clean-msgs new file mode 100755 index 0000000..5279641 --- /dev/null +++ b/etc/periodic/daily/130.clean-msgs @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $Id: 130.clean-msgs,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# +# remove system messages older than 21 days +# +if [ -d /var/msgs ] ; then + echo + echo "Cleaning out old system announcements:" + msgs -c +fi diff --git a/etc/periodic/daily/140.clean-rwho b/etc/periodic/daily/140.clean-rwho new file mode 100755 index 0000000..3a20dee --- /dev/null +++ b/etc/periodic/daily/140.clean-rwho @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $Id: 140.clean-rwho,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# + +if [ -d /var/rwho ] ; then + echo "" + echo "Removing stale files from /var/rwho" + cd /var/rwho && find . ! -name . -mtime +7 -exec rm -f -- {} \; +fi + diff --git a/etc/periodic/daily/200.backup-passwd b/etc/periodic/daily/200.backup-passwd new file mode 100755 index 0000000..bc2f8e9 --- /dev/null +++ b/etc/periodic/daily/200.backup-passwd @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $Id: 200.backup-passwd,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# +bak=/var/backups + +if [ -f /etc/master.passwd -o -f /etc/group ] ; then + echo "" + echo "Backup passwd and group files:" + + if [ ! -f $bak/master.passwd.bak ] ; then + echo "no $bak/master.passwd.bak" + cp -p /etc/master.passwd $bak/master.passwd.bak + fi + + if cmp -s $bak/master.passwd.bak /etc/master.passwd; then :; else + echo "$host passwd diffs:" + diff $bak/master.passwd.bak /etc/master.passwd |\ + sed 's/^\([<>] [^:]*\):[^:]*:/\1:(password):/' + mv $bak/master.passwd.bak $bak/master.passwd.bak2 + cp -p /etc/master.passwd $bak/master.passwd.bak + fi + + if [ ! -f $bak/group.bak ] ; then + echo "no $bak/group.bak" + cp -p /etc/group $bak/group.bak + fi + + if cmp -s $bak/group.bak /etc/group; then :; else + echo "$host group diffs:" + diff $bak/group.bak /etc/group + mv $bak/group.bak $bak/group.bak2 + cp -p /etc/group $bak/group.bak + fi +fi diff --git a/etc/periodic/daily/210.backup-aliases b/etc/periodic/daily/210.backup-aliases new file mode 100755 index 0000000..5e21bb4 --- /dev/null +++ b/etc/periodic/daily/210.backup-aliases @@ -0,0 +1,22 @@ +#!/bin/sh +# +# $Id: 210.backup-aliases,v 1.1.1.1 1997/08/12 17:51:16 pst Exp $ +# +bak=/var/backups + +if [ -f /etc/aliases ] ; then + echo "" + echo "Backing up mail aliases:" + + if [ ! -f $bak/aliases.bak ] ; then + echo "no $bak/aliases.bak" + cp -p /etc/aliases $bak/aliases.bak + fi + + if cmp -s $bak/aliases.bak /etc/aliases; then :; else + echo "$host aliases diffs:" + diff $bak/aliases.bak /etc/aliases + mv $bak/aliases.bak $bak/aliases.bak2 + cp -p /etc/aliases $bak/aliases.bak + fi +fi diff --git a/etc/periodic/daily/220.backup-distfile b/etc/periodic/daily/220.backup-distfile new file mode 100755 index 0000000..59defc4 --- /dev/null +++ b/etc/periodic/daily/220.backup-distfile @@ -0,0 +1,15 @@ +#!/bin/sh +# +# $Id: 220.backup-distfile,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# +bak=/var/backups + +if [ -f /etc/Distfile ]; then + echo "" + echo "Backing up /etc/Distfile" + + if cmp -s $bak/Distfile.bak /etc/Distfile; then :; else + mv $bak/Distfile.bak $bak/Distfile.bak2 + cp /etc/Distfile $bak/Distfile.bak + fi +fi diff --git a/etc/periodic/daily/300.calendar b/etc/periodic/daily/300.calendar new file mode 100755 index 0000000..8e5d195 --- /dev/null +++ b/etc/periodic/daily/300.calendar @@ -0,0 +1,17 @@ +#!/bin/sh +# +# $Id: 300.calendar,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# +# `calendar -a' needs to die. Why? Because it's a bad idea, particular +# with networked home directories, but also in general. If you want the +# output of `calendar' mailed to you, set up a cron job to do it, +# or run it from your ~/.profile or ~/.login. +# + +exit 0 # do not run by default + +if [ -f /usr/bin/calendar ] ; then + echo "" + echo "Running calendar:" + calendar -a +fi diff --git a/etc/periodic/daily/310.accounting b/etc/periodic/daily/310.accounting new file mode 100755 index 0000000..9162401 --- /dev/null +++ b/etc/periodic/daily/310.accounting @@ -0,0 +1,15 @@ +#!/bin/sh +# +# $Id: 310.accounting,v 1.1.1.1 1997/08/12 17:51:16 pst Exp $ +# + +if [ -f /var/account/acct ] ; then + echo "" + echo "Rotating accounting logs and gathering statistics:" + cd /var/account + if [ -f acct.2 ] ; then mv -f acct.2 acct.3 ; fi + if [ -f acct.1 ] ; then mv -f acct.1 acct.2 ; fi + if [ -f acct.0 ] ; then mv -f acct.0 acct.1 ; fi + cp -pf acct acct.0 + sa -s > /dev/null +fi diff --git a/etc/periodic/daily/320.rdist b/etc/periodic/daily/320.rdist new file mode 100755 index 0000000..73375fa --- /dev/null +++ b/etc/periodic/daily/320.rdist @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $Id: 320.rdist,v 1.1.1.1 1997/08/12 17:51:16 pst Exp $ +# + +if [ -f /etc/Distfile ]; then + echo "" + echo "Running rdist with /etc/Distfile:" + rdist -f /etc/Distfile +fi diff --git a/etc/periodic/daily/330.news b/etc/periodic/daily/330.news new file mode 100755 index 0000000..2cb3ff9 --- /dev/null +++ b/etc/periodic/daily/330.news @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $Id: 330.news,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# +# Expire news articles +# (This is present only for backwards compatibility, usually the news +# system handles this on its own). + +if [ -f /etc/news.expire ]; then + /etc/news.expire +fi diff --git a/etc/periodic/daily/340.uucp b/etc/periodic/daily/340.uucp new file mode 100755 index 0000000..d558e04 --- /dev/null +++ b/etc/periodic/daily/340.uucp @@ -0,0 +1,13 @@ +#!/bin/sh +# +# $Id: 340.uucp,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# +# Local cleanup of UUCP files. This is for backwards compatibility, +# /etc/uuclean.daily doesn't exist by default. +# +if [ -d /var/spool/uucp -a -f /etc/uuclean.daily ]; then + echo "" + echo "Cleaning up UUCP:" + echo /etc/uuclean.daily | su daemon +fi + diff --git a/etc/periodic/daily/400.status-disks b/etc/periodic/daily/400.status-disks new file mode 100755 index 0000000..b7a12d3 --- /dev/null +++ b/etc/periodic/daily/400.status-disks @@ -0,0 +1,14 @@ +#!/bin/sh +# +# $Id: 400.status-disks,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# + +echo "" +echo "Disk status:" + +df -k -t nonfs + +# display which filesystems need backing up + +echo "" +dump W diff --git a/etc/periodic/daily/410.status-uucp b/etc/periodic/daily/410.status-uucp new file mode 100755 index 0000000..1c76421 --- /dev/null +++ b/etc/periodic/daily/410.status-uucp @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $Id: 410.status-uucp,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# + +if [ -d /var/spool/uucp -a -x /usr/bin/uustat ]; then + echo "" + echo "uucp status:" + uustat -a +fi diff --git a/etc/periodic/daily/420.status-network b/etc/periodic/daily/420.status-network new file mode 100755 index 0000000..e61f311 --- /dev/null +++ b/etc/periodic/daily/420.status-network @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $Id: 420.status-network,v 1.1.1.1 1997/08/12 17:51:16 pst Exp $ +# + +if [ -x /usr/bin/netstat ] ; then + echo "" + echo "Network interface status:" + netstat -i +fi diff --git a/etc/periodic/daily/430.status-rwho b/etc/periodic/daily/430.status-rwho new file mode 100755 index 0000000..a86f83e --- /dev/null +++ b/etc/periodic/daily/430.status-rwho @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $Id: 430.status-rwho,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# + +if [ -d /var/rwho -a -x /usr/bin/rwho ] ; then + echo "" + echo "Local network system status:" + ruptime +fi diff --git a/etc/periodic/daily/440.status-mailq b/etc/periodic/daily/440.status-mailq new file mode 100755 index 0000000..1a45a51 --- /dev/null +++ b/etc/periodic/daily/440.status-mailq @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $Id: 440.status-mailq,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# +if [ -x /usr/sbin/mailq -a -d /var/spool/mqueue ] ; then + echo "" + echo "Mail in local queue:" + + mailq +fi diff --git a/etc/periodic/daily/450.status-security b/etc/periodic/daily/450.status-security new file mode 100755 index 0000000..6a1f040 --- /dev/null +++ b/etc/periodic/daily/450.status-security @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $Id: 450.status-security,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $ +# + +if [ -f /etc/security -a -x /usr/sbin/sendmail ] ; then + echo "" + echo "Security check (output mailed separately)" + + sh /etc/security 2>&1 | sendmail root +fi diff --git a/etc/periodic/daily/999.local b/etc/periodic/daily/999.local new file mode 100755 index 0000000..8a48c61 --- /dev/null +++ b/etc/periodic/daily/999.local @@ -0,0 +1,13 @@ +#!/bin/sh +# +# $Id: 999.local,v 1.1.1.1 1997/08/12 17:51:16 pst Exp $ +# +# Run the old /etc/daily.local script. This is really for backwards +# compatibility more than anything else. +# +if [ -f /etc/daily.local ]; then + echo "" + echo "Running daily.local:" + + sh /etc/daily.local +fi diff --git a/etc/periodic/daily/Makefile b/etc/periodic/daily/Makefile new file mode 100644 index 0000000..e701958 --- /dev/null +++ b/etc/periodic/daily/Makefile @@ -0,0 +1,24 @@ +# $Id: Makefile,v 1.1 1997/08/12 18:23:26 pst Exp $ + +BIN= 100.clean-disks \ + 110.clean-tmps \ + 120.clean-preserve \ + 130.clean-msgs \ + 140.clean-rwho \ + 200.backup-passwd \ + 210.backup-aliases \ + 220.backup-distfile \ + 300.calendar \ + 310.accounting \ + 320.rdist \ + 330.news \ + 340.uucp \ + 400.status-disks \ + 410.status-uucp \ + 420.status-network \ + 430.status-rwho \ + 440.status-mailq \ + 450.status-security \ + 999.local + +.include <bsd.prog.mk> |