MAILTO=REPL_MAILTO
MAILFROM=REPL_MAILFROM
PATH=/p4/common/bin:/p4/REPL_INSTANCE/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:
SHELL=/bin/bash
# common tasks
INSTANCE=REPL_INSTANCE
# Master Verify - Recommend to remove this line if you are running a DR replica server and just verify the replica.
5 4 * * 6 [ -e /p4/common/bin ] && /p4/common/bin/run_if_master.sh ${INSTANCE} /p4/common/bin/p4verify.sh ${INSTANCE}
# Update the limits group to make sure all users are listed in it.
*/60 * * * * [ -e /p4/common/bin ] && /p4/common/bin/run_if_master.sh ${INSTANCE} /p4/common/bin/update_limits.py ${INSTANCE}
# Checkpoints
# Run recreate_db_checkpoint.sh on the first Saturday afternoon in Jan. and July.
5 12 * 1,4,7,10 6 [ $(date +\%d) -le 07 ] && /p4/common/bin/run_if_master.sh ${INSTANCE} /p4/common/bin/rotate_journal.sh ${INSTANCE}
5 13 * 1,4,7,10 6 [ $(date +\%d) -le 07 ] && /p4/common/bin/run_if_master.sh ${INSTANCE} /p4/common/bin/recreate_db_checkpoint.sh ${INSTANCE}
5 2 * * * [ -e /p4/common/bin ] && /p4/common/bin/run_if_master.sh ${INSTANCE} /p4/common/bin/daily_checkpoint.sh ${INSTANCE}
35 13 * 1,4,7,10 6 [ $(date +\%d) -le 07 ] && /p4/common/bin/run_if_edge.sh ${INSTANCE} /p4/common/bin/recreate_db_checkpoint.sh ${INSTANCE}
35 2 * * * [ -e /p4/common/bin ] && /p4/common/bin/run_if_edge.sh ${INSTANCE} /p4/common/bin/daily_checkpoint.sh ${INSTANCE}
# p4review daemon
*/5 * * * * [ -e /p4/common/bin ] && /p4/common/bin/run_if_master.sh ${INSTANCE} /p4/common/bin/p4review.py ${INSTANCE}
# Replica Tasks
# Verify
# Run verify on the first Sat. of each month.
5 15 * 1,2,3,4,5,6,7,8,9,10,11,12 6 [ $(date +\%d) -le 07 ] && /p4/common/bin/run_if_replica.sh ${INSTANCE} /p4/common/bin/p4verify.sh ${INSTANCE}
# Sync checkpoints from master
0 8 * * 0-6 [ -e /p4/common/bin ] && /p4/common/bin/run_if_replica.sh ${INSTANCE} /p4/common/bin/sync_replica.sh ${INSTANCE}
# Run recreate_db_checkpoint.sh on the first Saturday afternoon in Jan. and July.
5 18 * 1,7 6 [ $(date +\%d) -le 07 ] && /p4/common/bin/run_if_replica.sh ${INSTANCE} /p4/common/bin/recreate_db_sync_replica.sh ${INSTANCE}
# If you can't run the scripts above due to rsync issues, then run this one instead.
# 0 5 * * 0-5 [ -e /p4/common/bin ] && /p4/common/bin/run_if_replica.sh ${INSTANCE} /p4/common/bin/replica_cleanup.sh ${INSTANCE}
# Replica Status
0 8 * * * [ -e /p4/common/bin ] && /p4/common/bin/run_if_replica.sh ${INSTANCE} /p4/common/bin/replica_status.sh ${INSTANCE} > /dev/null
0 8 * * * [ -e /p4/common/bin ] && /p4/common/bin/run_if_edge.sh ${INSTANCE} /p4/common/bin/replica_status.sh ${INSTANCE} > /dev/null