]> git.deb.at Git - deb/packages.git/blobdiff - bin/daily
daily: Simplify and reduce lockfile wait
[deb/packages.git] / bin / daily
index f9e8853f77e64f1511c73c170464190a8268e464..44c458e1fe2a5b96ee269c87e99ea33ee6f19b22 100755 (executable)
--- a/bin/daily
+++ b/bin/daily
@@ -14,7 +14,7 @@
 #
 #   You should have received a copy of the GNU General Public License
 #   along with this program; if not, write to the Free Software
-#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 # Should run after the mirror pulse.  The mirror tends to finish by
 # the ctime of rsync.log.* in ~archvsync.
@@ -32,14 +32,24 @@ then
     savelog -c 14 $log > /dev/null
 fi
 
-date > $log
+exec >"$log" 2>&1
 
-if lockfile -600 -r5 "${files}/cron.lock" >> $log 2>&1
+date
+
+if lockfile -300 -r2 "${files}/cron.lock"
 then
-    run-parts --verbose $topdir/cron.d >> $log 2>&1
+    run-parts --verbose $topdir/cron.d
     rm -f "${files}/cron.lock"
 else
-    echo "couldn't aquire lock file in due time" >> $log
+    echo "couldn't aquire cron lock file in due time"
 fi
+date
 
-date >> $log
+if lockfile -300 -r2 "${files}/changelogs.lock"
+then
+    $topdir/bin/extract_changelogs
+    rm -f "${files}/changelogs.lock"
+else
+    echo "couldn't aquire changelogs lock file in due time"
+fi
+date