[CentOS-mirror] rsync lock files

Patrick Shaw

patrick at shaw.co.th
Fri Mar 8 13:32:31 UTC 2019


OK thanks for your help with that :-)



On 8/3/62 14:56, Alpix wrote:
> Hey Patrick,
>
> thats my sync script.
>
>         #!/bin/bash
>
>
>         DESTPATH="/var/www/mirror/centos/"
>
>         RSYNC=/usr/bin/rsync
>
>         LOCKFILE=/tmp/rsync-centos.lock
>
>
>
>
>         synchronize() {
>
>             $RSYNC -rltvHa --delete-after --delay-updates --safe-links
>         eu-msync.centos.org::CentOS "$DESTPATH"
>
>         }
>
>
>
>
>         if [ ! -e "$LOCKFILE" ]
>
>         then
>
>             echo $$ >"$LOCKFILE"
>
>             synchronize
>
>         else
>
>             PID=$(cat "$LOCKFILE")
>
>             if kill -0 "$PID" >&/dev/null
>
>             then
>
>                 echo "Rsync - Synchronization still running"
>
>                 exit 0
>
>             else
>
>                 echo $$ >"$LOCKFILE"
>
>                 echo "Warning: previous synchronization appears not to
>         have finished correctly"
>
>                 synchronize
>
>             fi
>
>         fi
>
>
>         rm -f "$LOCKFILE"
>
>
> Greetings Alpix
>
>
> Am Fr., 8. März 2019 um 08:47 Uhr schrieb Alpix <contact at alpix.eu 
> <mailto:contact at alpix.eu>>:
>
>     Hello Patrick,
>
>     i have one.
>     I will send it  in a few minutes.
>
>     Greetings
>
>
>     Patrick Shaw <patrick at shaw.co.th <mailto:patrick at shaw.co.th>>
>     schrieb am Fr., 8. März 2019, 08:42:
>
>         Hi,
>
>         Does anyone have some examples of lock scripts/files for
>         rsync? Due to
>         slow international performance in this country I'm regularly
>         seeing
>         overlapping rsyncs, I need to get that locked down ASAP.
>
>         Patrick
>
>
>         _______________________________________________
>         CentOS-mirror mailing list
>         CentOS-mirror at centos.org <mailto:CentOS-mirror at centos.org>
>         https://lists.centos.org/mailman/listinfo/centos-mirror
>
>
> _______________________________________________
> CentOS-mirror mailing list
> CentOS-mirror at centos.org
> https://lists.centos.org/mailman/listinfo/centos-mirror

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos-mirror/attachments/20190308/2eab9df3/attachment-0002.html>


More information about the CentOS-mirror mailing list