aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mirror/templates/mirrordir
blob: b8bf9fb6ff74c3cf47ae79be20599594193bd4db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

remoteurl="<%= remoteurl%>"
localdir="<%= localdir %>"
rsync_options="<%= rsync_options %>"
lockfile="<%= lockfile %>"

if [ -f "$lockfile" ]; then
    # show error message when run from command line
    [ -t 1 ] && cat $lockfile
    exit
fi
echo "sync in progress since $(date)" > "$lockfile"
/usr/bin/rsync $rsync_options "$remoteurl" "$localdir"
rm -f "$lockfile"