[web-doc] master: The "cron" jobs can be managed from Git.

[email protected] (Nilgün Belma Bugüner) Fri, 21 May 2021 03:02:00 +0000
Newsgroups php.doc.web
Message-ID <[email protected]>
Author: Nilgün Belma Bugüner (nilgun)
Date: 2021-05-21T06:02:02+03:00

Commit: https://github.com/php/web-doc/commit/6bbd4d66e4a68f31c322ca6032fe9c7f5ef9a188
Raw diff: https://github.com/php/web-doc/commit/6bbd4d66e4a68f31c322ca6032fe9c7f5ef9a188.diff

The "cron" jobs can be managed from Git.

Changed paths:
  A  cron/hourly/populatedocs
  D  cron/crontab
  D  cron/daily/populatedocs


Diff:

diff --git a/cron/crontab b/cron/crontab
deleted file mode 100644
index 1224a77..0000000
--- a/cron/crontab
+++ /dev/null
@@ -1,2 +0,0 @@
-30 */4 * * * /local/src/docweb/cron/daily/populatedocs
- 
\ No newline at end of file
diff --git a/cron/daily/populatedocs b/cron/hourly/populatedocs
similarity index 75%
rename from cron/daily/populatedocs
rename to cron/hourly/populatedocs
index b840631..f1e1494 100755
--- a/cron/daily/populatedocs
+++ b/cron/hourly/populatedocs
@@ -1,5 +1,11 @@
 #!/bin/sh
 
+# Only run every 4 hours
+HOUR=`/bin/date +%H`
+if [ `expr $HOUR % 4` -ne 0 ]; then
+    exit 0
+fi
+
 # This task run two shell scripts responsible for revision check
 # - populatedocs.sh - checking out SVN docs repository into local filesystem
 # - generation.sh - generating revision check database and charts