mirror-all.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash -e
  2. ##
  3. ## Wrapper around mirroring scripts.
  4. ##
  5. ## Currently we do all Debian distributions.
  6. ## To mirror a specific one, change apt-mirror configuration and filter the
  7. ## types of Packages.bz2 and Sources.bz2 files to include.
  8. ##
  9. dir=/srv/http/htdocs/apt-sec
  10. action="$1"
  11. # echo "Waiting for lock.."
  12. # lockfile-create /var/lock/aptsec-mirror
  13. # lockfile-touch /var/lock/aptsec-mirror &
  14. # BADGER="$!"
  15. echo -n "$(date +%x\ %R): "
  16. echo "Launching main apt-sec mirroring"
  17. if [ "A$action" = "Ainit" ]; then
  18. echo "Re-initializing mirror state.."
  19. rm -f $dir/mirror/cache/*
  20. fi
  21. apt-mirror|grep -v "^Proceed indexes\|\]\.\.\.\|^Removing \|^Begin time:\|^End time:"
  22. echo -n "$(date +%x\ %R): "
  23. echo "Done synching package data."
  24. $dir/gen-sha1-list.sh $action|sed s/"^Adding .*deb.."/"Packets added"/|uniq -c
  25. echo
  26. $dir/gen-pkg-lists.sh $action
  27. echo -n "$(date +%x\ %R): "
  28. echo "Done synching meta data"
  29. $dir/mirror-advisories.sh
  30. $dir/mirror-cves.sh
  31. echo -n "$(date +%x\ %R): "
  32. echo "Done syncing advisory data"
  33. # kill "${BADGER}"
  34. # lockfile-remove /var/lock/aptsec-mirror