2
0

ubuntu_debmirror.sh 922 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. SYNC_FILES="$TUNASYNC_WORKING_DIR"
  3. # SYNC_FILES="/srv/mirror_disk/ubuntu/_working/"
  4. #LOG_FILE="$TUNASYNC_LOG_FILE"
  5. # [ -f $SYNC_LOCK ] && exit 1
  6. # touch $SYNC_LOCK
  7. echo ">> Starting sync on $(date --rfc-3339=seconds)"
  8. arch="i386,amd64"
  9. sections="main,main/debian-installer,multiverse,multiverse/debian-installer,restricted,restricted/debian-installer,universe,universe/debian-installer"
  10. dists="precise,precise-backports,precise-proposed,precise-updates,precise-security,trusty,trusty-backports,trusty-proposed,trusty-updates,trusty-security"
  11. server="$1"
  12. inPath="/ubuntu"
  13. proto="rsync"
  14. outpath="$SYNC_FILES"
  15. rsyncOpt='-6 -aIL --partial'
  16. debmirror -h $server --no-check-gpg -a $arch -s $sections -d $dists -r $inPath -e $proto --rsync-options "$rsyncOpt" --verbose $outpath
  17. date --rfc-3339=seconds > "$SYNC_FILES/lastsync"
  18. echo ">> Finished sync on $(date --rfc-3339=seconds)"
  19. # rm -f "$SYNC_LOCK"
  20. exit 0