summaryrefslogtreecommitdiffstats
path: root/tools/debian-build-cron.sh
diff options
context:
space:
mode:
authorRick Bradshow <bradshaw@mcs.anl.gov>2006-02-27 18:30:10 +0000
committerRick Bradshow <bradshaw@mcs.anl.gov>2006-02-27 18:30:10 +0000
commitfc9881381c8bb4d6e729532de2fe030b3ff418b3 (patch)
treee947bc5158e16eb4fc5173eaca8fe45c7121b5d2 /tools/debian-build-cron.sh
parent5e6b51308eaf85dbb51998fd53e698b75767f604 (diff)
downloadbcfg2-fc9881381c8bb4d6e729532de2fe030b3ff418b3.tar.gz
bcfg2-fc9881381c8bb4d6e729532de2fe030b3ff418b3.tar.bz2
bcfg2-fc9881381c8bb4d6e729532de2fe030b3ff418b3.zip
I updated all my repo scripts for the latest changes in the 0.8 version of
the repo. these are still very specific to my repo, but should give a good idea of what is needed. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1772 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'tools/debian-build-cron.sh')
-rw-r--r--tools/debian-build-cron.sh42
1 files changed, 30 insertions, 12 deletions
diff --git a/tools/debian-build-cron.sh b/tools/debian-build-cron.sh
index 055f5b547..c03111412 100644
--- a/tools/debian-build-cron.sh
+++ b/tools/debian-build-cron.sh
@@ -1,15 +1,33 @@
#!/bin/sh
-if /root/bin/rsync-debian-repo ; then
- mv /cluster/bcfg/images/debian-3.0/pkglist.xml /cluster/bcfg/images/debian-3.0/pkglist.xml.old;
- if /root/bin/create-debian-pkglist.pl ; then
- /etc/init.d/bcfgd restart
- else
- mv /cluster/bcfg/images/debian-3.0/pkglist.xml.old /cluster/bcfg/images/debian-3.0/pkglist.xml;
- echo "there was a problem with creating the new pkglist.xml";
- exit 1;
- fi
+# rsync all the repo stuff to keep it up to date
+# this pulls the debian repo from mirror.mcs.anl.gov if the currect sync is finished.
+# If it isn't finished it will just back off and try again when the script runs next time.
+
+if ! /root/bin/rsync-debian-repo ; then
+ echo "repo not synced ";
+fi
+
+# now rebuild the local repo so that it will grab everything that was added today.
+if ! /root/bin/local-deb-repo-maker ; then
+ echo "local repos are not up to date ";
+fi
+
+#make a back up of the current pkglist so we can diff later
+cp /disks/bcfg2/Pkgmgr/debian-sarge.xml /tmp/debian-sarge.xml.current
+
+if /root/bin/create-debian-pkglist.pl ; then
+ diff /tmp/debian-sarge.xml.current /disks/bcfg2/Pkgmgr/debian-sarge.xml
+ rm -f /tmp/debian-sarge.xml.current
+
+ #this is mainly cause this dies from time to time.. so this is protection
+ /etc/init.d/apt-proxy restart
else
- echo "repo not synced and bcfg not updates";
- exit 1;
+ echo "there was a problem with creating the new pkglist.xml";
+ exit 1;
fi
-exit 0;
+
+#this was problem-matic so I found that it was more realiable to just make its
+#own cron job to restart every couple of days to reduce the memory consumption
+#restart the server.. shouldn't be needed but memory leaks make it needed.
+#/etc/init.d/bcfg2-server restart
+