Browse Source

added locking to all mirror scripts

master
Johannes Findeisen 1 month ago
parent
commit
587adae326
7 changed files with 32 additions and 2 deletions
  1. +1
    -1
      alpine.sh
  2. +1
    -1
      arch.sh
  3. +6
    -0
      archstrike.sh
  4. +6
    -0
      artix.sh
  5. +6
    -0
      blackarch.sh
  6. +6
    -0
      fdroid.sh
  7. +6
    -0
      openwrt.sh

+ 1
- 1
alpine.sh View File

@@ -1,7 +1,7 @@
#!/usr/bin/env sh

# make sure we never run 2 rsync at the same time
lockfile="/tmp/alpine-mirror.lock"
lockfile="/data/tmp/alpine-mirror.lock"
if [ -z "$flock" ] ; then
exec env flock=1 flock -n $lockfile "$0" "$@"
fi

+ 1
- 1
arch.sh View File

@@ -16,7 +16,7 @@ target="/data/mirrors/arch"
tmp="/data/tmp"

# Lockfile path
lock="/data/tmp/syncrepo.lck"
lock="/data/tmp/arch-mirror.lock"

# If you want to limit the bandwidth used by rsync set this.
# Use 0 to disable the limit.

+ 6
- 0
archstrike.sh View File

@@ -1,4 +1,10 @@
#!/usr/bin/env sh

# make sure we never run 2 rsync at the same time
lockfile="/data/tmp/archstrike-mirror.lock"
if [ -z "$flock" ] ; then
exec env flock=1 flock -n $lockfile "$0" "$@"
fi

rsync -auvPH --delete-after rsync://mirror.archstrike.org/archstrike /data/mirrors/archstrike/


+ 6
- 0
artix.sh View File

@@ -1,5 +1,11 @@
#!/bin/bash

# make sure we never run 2 rsync at the same time
lockfile="/data/tmp/artix-mirror.lock"
if [ -z "$flock" ] ; then
exec env flock=1 flock -n $lockfile "$0" "$@"
fi

rsync -auvPH --delete-after "rsync://mirrors.dotsrc.org/artix-linux/" /data/mirrors/artix/

#rsync -auvPH --delete-after "rsync://orion.artixlinux.org:64873/" /data/artix/repos/

+ 6
- 0
blackarch.sh View File

@@ -1,4 +1,10 @@
#!/bin/sh

# make sure we never run 2 rsync at the same time
lockfile="/data/tmp/blackarch-mirror.lock"
if [ -z "$flock" ] ; then
exec env flock=1 flock -n $lockfile "$0" "$@"
fi

rsync -auvPH --delete-after "rsync://ftp.halifax.rwth-aachen.de/blackarch/" /data/mirrors/blackarch/


+ 6
- 0
fdroid.sh View File

@@ -1,4 +1,10 @@
#!/bin/sh

# make sure we never run 2 rsync at the same time
lockfile="/data/tmp/fdroid-mirror.lock"
if [ -z "$flock" ] ; then
exec env flock=1 flock -n $lockfile "$0" "$@"
fi

rsync -auvPH --delete-after "rsync://rsync.cyberbits.eu/fdroid/" /data/mirrors/fdroid/fdroid/


+ 6
- 0
openwrt.sh View File

@@ -1,4 +1,10 @@
#!/bin/sh

# make sure we never run 2 rsync at the same time
lockfile="/data/tmp/openwrt-mirror.lock"
if [ -z "$flock" ] ; then
exec env flock=1 flock -n $lockfile "$0" "$@"
fi

#rsync -auvPH --delete-after "rsync://downloads.openwrt.org/downloads" /shared/hanez/openwrt/


Loading…
Cancel
Save