Initial configuration

Periodic job configuration

by ross at 04:43:19 on March 12, 2014

See periodic.conf(7) and /etc/defaults/periodic.conf. Setup periodic jobs:

/etc/periodic.conf:

# Clean /tmp
daily_clean_tmps_enable="YES"
daily_clean_tmps_days="3"

# If you installed sysutils/smartmontools:
daily_status_smart_devices="AUTO"

# Uncomment if you use zfs
#daily_status_zfs_enable="YES"

# Uncomment if you use gmirror
#daily_status_gmirror_enable="YES"

# Uncomment if you use gstripe
#daily_status_gstripe_enable="YES"

# Uncomment if you don't use sendmail
#daily_clean_hoststat_enable="NO"
#daily_status_mail_rejects_enable="NO"
#daily_status_include_submit_mailq="NO"
#daily_submit_queuerun="NO"

Additional periodic scripts

Hourly periodic scripts support

If you are going to use/create hourly scripts you need to add support for it:

Add to /etc/periodic.conf:

hourly_output="root"       # user or /file
hourly_show_success="NO"   # scripts returning 0
hourly_show_info="YES"     # scripts returning 1
hourly_show_badconfig="NO" # scripts returning 2

Add to /etc/crontab:

1       *       *       *       *       root    periodic hourly
# mkdir /etc/periodic/hourly
# service cron restart

ZFS snapshots

Install sysutils/zfs-periodic. It will list available variables on install. I use it like this (/etc/periodic.conf):

daily_zfs_snapshot_enable="YES"
daily_zfs_snapshot_pools="system"
daily_zfs_snapshot_keep=7
monthly_zfs_scrub_enable="YES"
monthly_zfs_scrub_pools="system"

Hourly disk-free status check

This script requires hourly periodic support and is written for UFS.

# mkdir -p /usr/local/etc/periodic/hourly
# cd /usr/local/etc/periodic/hourly
# fetch http://daemon-notes.com/downloads/assets/scripts/900.status-df
# chmod a+x 900.status-df

Look inside 900.status-df for available variables.

Daily directories backup

# mkdir -p /usr/local/etc/periodic/daily
# cd /usr/local/etc/periodic/daily
# fetch http://daemon-notes.com/downloads/assets/scripts/250.backup-dirs
# chmod a+x 250.backup-dirs

Look inside 250.backup-dirs for available variables. I use it backup /etc, /usr/local/etc, /root, /var/cron/tabs and directories of virtual hosts.

Daily SVN repositories backup

# mkdir -p /usr/local/etc/periodic/daily
# cd /usr/local/etc/periodic/daily
# fetch http://daemon-notes.com/downloads/assets/scripts/251.backup-svn
# chmod a+x 251.backup-svn

Look inside 251.backup-svn for available variables.

 

Comments
must be hourLy, i guess:

# mkdir -p /usr/local/etc/periodic/houry
-- JsN
Thursday, May 30, 2013, 10:35:27
thanks..!
-- linuxonlinehelp_de
Friday, March 7, 2014, 2:59:46