Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [L:h3cstor] /opt/mirror# cat _commonvar
- RSYNC=/usr/bin/rsync
- PATH=/usr/local/bin:/usr/bin:/bin
- PIDPREFIX=/tmp
- LOGPATH=/var/log
- MIRRORROOT=/export/mirror
- [L:h3cstor] /opt/mirror# cat daily
- #!/bin/sh
- # Load common varables for mirroring
- . /opt/mirror/_commonvar
- RSYNC_OPTIONS="-a --delete --safe-links"
- [L:h3cstor] /opt/mirror# cat frequently
- #!/bin/bash
- # Load common varables for mirroring
- . /opt/mirror/_commonvar
- RSYNC_OPTIONS="-a --delete --safe-links --timeout=10"
- # CPAN
- if [ -f ${PIDPREFIX}/cpan.pid ] ; then
- if [ -d /proc/`cat ${PIDPREFIX}/cpan.pid` ] ; then
- kill `cat ${PIDPREFIX}/cpan.pid`
- fi
- rm ${PIDPREFIX}/cpan.pid
- fi
- ${RSYNC} ${RSYNC_OPTIONS} rsync://cpan-rsync.perl.org/CPAN/ ${MIRRORROOT}/CPAN/ &
- echo $! > ${PIDPREFIX}/cpan.pid
- sleep 600
- # CTAN
- if [ -f ${PIDPREFIX}/ctan.pid ] ; then
- if [ -d /proc/`cat ${PIDPREFIX}/ctan.pid` ] ; then
- kill `cat ${PIDPREFIX}/ctan.pid`
- fi
- rm ${PIDPREFIX}/ctan.pid
- fi
- ${RSYNC} ${RSYNC_OPTIONS} rsync://rsync.tug.ctan.org/CTAN ${MIRRORROOT}/CTAN/ &
- echo $! > ${PIDPREFIX}/ctan.pid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement