De:OnTime
Aus YaCyWiki
Crawler zeitgesteuert aktivieren/deaktivieren
Einfach in die crontab folgendes eintragen um den Crawler täglich z.B. um 2 Uhr Nachts zu starten und um 7 Uhr wieder zu pausieren:
# pausing yacy crawler every day at 7:00 0 7 * * * /usr/bin/curl http://localhost:8080/WatchCrawler_p.html -u admin:adminPWD -F pausecrawlqueue=on # continuing crawling at 2:00 0 2 * * * /usr/bin/curl http://localhost:8080/WatchCrawler_p.html -u admin:adminPWD -F continuecrawlqueue=on
In dem Fall wird dann bei jeder Ausführung eine e-Mail versandt. Möchte man eine Mail nur im Fehlerfall muß nur der Standartoutput umgeleitet werden ( foo > /dev/null )
# pausing yacy crawler every day at 7:00 0 7 * * * /usr/bin/curl http://localhost:8080/WatchCrawler_p.html -u admin:adminPWD -F pausecrawlqueue=on > /dev/null # continuing crawling at 2:00 0 2 * * * /usr/bin/curl http://localhost:8080/WatchCrawler_p.html -u admin:adminPWD -F continuecrawlqueue=on > /dev/null
Möchte man auch im Fehlerfall keine Mailbenachrichtigung leitet man Standard- und Fehlerausgabe um (foo &> /dev/null )
# pausing yacy crawler every day at 7:00 0 7 * * * /usr/bin/curl http://localhost:8080/WatchCrawler_p.html -u admin:adminPWD -F pausecrawlqueue=on &> /dev/null # continuing crawling at 2:00 0 2 * * * /usr/bin/curl http://localhost:8080/WatchCrawler_p.html -u admin:adminPWD -F continuecrawlqueue=on &> /dev/null