p4d.crondaily #1

  • //
  • guest/
  • matthew_rice/
  • Solaris/
  • p4d.crondaily
  • View
  • Commits
  • Open Download .zip Download (630 B)
#!/bin/sh

p4d_config=/var/perforce/p4d.config
p4d=/usr/sbin/p4d
find=find
maxdepth=
comp=compress
ext=Z

[ -f ${p4d_config} ] && . ${p4d_config}
export P4JOURNAL P4PORT P4ROOT
umask $P4UMASK

trap 'rm -f /tmp/p4d.$$' 0 1 2 15
${p4d} -jc >/dev/null 2>/tmp/p4d.$$

# p4d doesn't return meaningful exit codes -- assume failure if it
# produced any output on stderr.
if [ -s /tmp/p4d.$$ ]; then
    cat /tmp/p4d.$$
    exit 1
fi

# age checkpoints
cd $P4ROOT
${comp} checkpoint.*[0-9] journal.*[0-9]
${find} . ${maxdepth} \( -name checkpoint.\[0-9\]\*.$ext -o \
			-name journal.\[0-9\]\*.$ext \) \
			-a -mtime +14 |\
	xargs rm -f

# Change User Description Committed
#1 579 Matthew Rice Added Solaris versions of initscripts and checkpointing.