1984263bcSMatthew Dillon#!/bin/sh 2984263bcSMatthew Dillon# 3*c451e5e9SAaron LI# $FreeBSD: head/etc/periodic/daily/400.status-disks 290743 2015-11-13 06:20:27Z des $ 4984263bcSMatthew Dillon# 5984263bcSMatthew Dillon 6984263bcSMatthew Dillon# If there is a global system configuration file, suck it in. 7984263bcSMatthew Dillon# 8984263bcSMatthew Dillonif [ -r /etc/defaults/periodic.conf ] 9984263bcSMatthew Dillonthen 10984263bcSMatthew Dillon . /etc/defaults/periodic.conf 11984263bcSMatthew Dillon source_periodic_confs 12984263bcSMatthew Dillonfi 13984263bcSMatthew Dillon 14984263bcSMatthew Dilloncase "$daily_status_disks_enable" in 15984263bcSMatthew Dillon [Yy][Ee][Ss]) 16984263bcSMatthew Dillon echo "" 17984263bcSMatthew Dillon echo "Disk status:" 18984263bcSMatthew Dillon 19*c451e5e9SAaron LI if [ -n "${daily_status_disks_ignore}" ] ; then 20*c451e5e9SAaron LI ignore="egrep -v ${daily_status_disks_ignore}" 21*c451e5e9SAaron LI else 22*c451e5e9SAaron LI ignore="cat" 23*c451e5e9SAaron LI fi 24*c451e5e9SAaron LI (df $daily_status_disks_df_flags | ${ignore}) && rc=1 || rc=3 25984263bcSMatthew Dillon 26984263bcSMatthew Dillon # display which filesystems need backing up 27*c451e5e9SAaron LI if [ -s /etc/dumpdates ]; then 28*c451e5e9SAaron LI if ! [ -f /etc/fstab ]; then 29*c451e5e9SAaron LI export PATH_FSTAB=/dev/null 30*c451e5e9SAaron LI fi 31984263bcSMatthew Dillon 32984263bcSMatthew Dillon echo "" 33*c451e5e9SAaron LI dump W || rc=3 34*c451e5e9SAaron LI fi 35*c451e5e9SAaron LI ;; 36984263bcSMatthew Dillon 37984263bcSMatthew Dillon *) rc=0;; 38984263bcSMatthew Dillonesac 39984263bcSMatthew Dillon 40984263bcSMatthew Dillonexit $rc 41