To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / deploy / provision.d / 140-cron.sh @ 1608:b8e5e9734526

History | View | Annotate | Download (579 Bytes)

1 1590:c18460da6620 Chris
#!/bin/bash
2
3
set -e
4
5
# Copy cron scripts to the appropriate destinations
6
7
cd /var/www/code
8
9
if [ ! -d /etc/cron.minutely ]; then
10
    mkdir -p /etc/cron.minutely
11
    echo '*  *    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.minutely )' >> /etc/crontab
12
fi
13
14
for t in minutely hourly daily monthly; do
15
    for s in deploy/config/cron.$t/[0-9]* ; do
16
        name=$(basename $s)
17
        dest="/etc/cron.$t/$name"
18
        if [ ! -f "$dest" ]; then
19
            cp "$s" "$dest"
20
            chmod +x "$dest"
21
        fi
22
    done
23
done
24
25