{"id":318,"date":"2009-07-17T11:04:11","date_gmt":"2009-07-17T16:04:11","guid":{"rendered":"http:\/\/it.thelibrarie.com\/weblog\/?p=318"},"modified":"2009-07-17T11:04:11","modified_gmt":"2009-07-17T16:04:11","slug":"awstats-scheduled-task-0x1-error","status":"publish","type":"post","link":"https:\/\/it.thelibrarie.com\/weblog\/2009\/07\/awstats-scheduled-task-0x1-error\/","title":{"rendered":"Awstats Scheduled Task 0x1 Error"},"content":{"rendered":"<p>After installing Perl, Awstats, IIS6.0 and all the available Windows Updates on a system, I mapped drive shares on several other webservers.  I mean, why install perl and awstats on each individual server when I can have a virtual machine ready and waiting and have no downtime on the production sites?<\/p>\n<p>So I had the batch script file setup to update the stats every 5 minutes for 24 hours of every day (288 updates a day):<\/p>\n<p><code>@echo off<\/code><br \/>\n<code>cd C:\\Inetpub\\wwwroot\\awstats\\cgi-bin<\/code><br \/>\n<code>awstats.pl -config=myconfig -update<\/code><\/p>\n<p>I saved it as Test.bat, opened up the batch file to test it out and it ran AND updated perfectly.  Yay, that wasn&#8217;t too difficult.<\/p>\n<p>But then I created an automated task in Windows.  Run it every 5 minutes.  Error 0x1 every time.  WTF??<\/p>\n<p>It&#8217;s because &#8220;Perl is an interpreted language, and you cannot define a task priority or a maximum CPU usage value when you run a Perl program&#8221; (thanks <a href=\"http:\/\/www.devx.com\/webdev\/Article\/30108\/0\/page\/4\">Devx.com<\/a>!).  You have to start the command first.<\/p>\n<p>So the finished code should look like this:<br \/>\n<code>@echo off<\/code><br \/>\n<code>cd C:\\Inetpub\\wwwroot\\awstats\\cgi-bin<\/code><br \/>\n<code>start awstats.pl -config=myconfig -update<\/code><\/p>\n<p>Try to run it again, works when just opening the BAT file.  Then try it automated.  0x0!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After installing Perl, Awstats, IIS6.0 and all the available Windows Updates on a system, I mapped drive shares on several other webservers. I mean, why install perl and awstats on each individual server when I can have a virtual machine ready and waiting and have no downtime on the production sites? So I had the &hellip; <a href=\"https:\/\/it.thelibrarie.com\/weblog\/2009\/07\/awstats-scheduled-task-0x1-error\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Awstats Scheduled Task 0x1 Error<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-318","post","type-post","status-publish","format-standard","hentry","category-microsoft"],"_links":{"self":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/comments?post=318"}],"version-history":[{"count":1,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"predecessor-version":[{"id":319,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/318\/revisions\/319"}],"wp:attachment":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}