Cleaned up updateCalendar.sh
[clearscm.git] / bin / setup_cron
1 #!/bin/bash
2 ################################################################################
3 #
4 # File:         $RCSfile: setup_cron,v $
5 # Revision:     $Revision: 1.2 $
6 # Description:  This script sets up Cygwin's cron on the local machine
7 # Author:       Andrew@DeFaria.com
8 # Created:      Somewhere in 2003 or so...
9 # Modified:     $Date: 2010/06/08 15:03:27 $
10 # Language:     Bash
11 #
12 # (c) Copyright 2002, ClearSCM, Inc., all rights reserved
13 #
14 ################################################################################
15 me=$(basename $0)
16 # Make sure that certain directories and files do not exist! This is to let
17 # cron create them, which appears to be the only way to get these created
18 # correctly! 
19 if [ ! -d /var/cron ]; then
20   rm -rf /var/cron
21   rm -rf /var/run/cron.pid
22   rm -rf /var/log/cron.log
23
24   # Install cron service:
25   cygrunsrv -I cron -p /usr/sbin/cron -a -D -d "Cygwin cron" -e "MAILTO=$USER@Salira.com" -e "CYGWIN=ntsec"
26 fi
27
28 # Start cron service
29 cygrunsrv -S cron