awstats를 cron에 넣어서 실행시키려면.... (설명 추가했습니다.

kjd2338의 이미지

며칠전에 웹호스팅을 졸업하고 자체 서버의 그 무한한 삽질의 가능성으로 뛰어들었습니다...^^
다른 것은 거의 다 되었으나... cron이 awstats 정기 실행을 거부하는 것이지요.....
crontab에 '00 1 * * * root /~~~/cgi-bin/awstats.pl -config=mydomain.info update'로 설정을 했습니다...
(당연히 root 권한으로 매일 1시에 ........경로의 놈을 실행하라는 코드입니다만....)
shell상에서는 잘 되거든요...
크론 로그에는 그냥 실행했다만 나오니....
다른 시스템 로그에는 어디에도 성공 실패여부가 나오지 않고, 뭐가 문제인지 오류메세지도 알리지를 않으니 알 수가 없습니다...
구글링을 해보아도 뾰족한 수가 없고..... 어찌할런지....

codebank의 이미지

cron에 대한 질문이 올라올때마다 하는 이야기지만 해당 명령을 스크립트로 작성하고
그 스크립트를 실행해보세요.
즉,

# cat run.sh
#!/bin/perl
cd /~~~/cgi-bin/
./awstats.pl -config=...

이런 스크립트를 만들고
crontab에는 run.sh을 실행시키도록 하십시요.
이유는... cron에서는 환경변수가 없습니다. 즉, perl이나 shell용 명령이 먹지 않는다는
소리입니다. 따라서 원문의 awstats.pl이 스크립트라고 하더라도 perl에 매칭을
시키지 않습니다. 따라서 직접 해당 동작을하는 스크립트를 만들어서 그 스크립트를
실행시켜야합니다.
또한... 스크립트내부에도 될 수 있으면 절대경로를 이용해서 작성해 놓는것이
좋습니다.

그럼 꼭 성공하시길... :)

------------------------------
좋은 하루 되세요.

kjd2338의 이미지

감사합니다...^^

그런데 cron에서 root를 아니라 perl로 바꿨더니 잘 되네요...
조금전에 혹시나 해서 바꿨다가 매우 허탈해졌습니다...

인생은 삽질에서 시작해서, 삽질로 끝난다...

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.