« OpenFL + Store::Fastladderで広告エントリーの削除と全文取得をする | ホーム | Vimperatorプラグインのsbmcommentsviewer.jsにtagsAndComment追加した »

2008年5月27日

Plaggerをcronで定期実行する

Plaggerをcronで定期実行する

crontabではほとんどの環境変数が設定されていないらしいので、そのままTerminalと同じコマンドを打っても動作しないことがある。

crontab で実行されるときには、ほとんどの環境変数が設定されていないので注意が必要。~/.cshrc・~/.login で設定している環境変数は設定されていないし、PATH も /bin:/usr/bin くらいにしか通っていない。そのため、command の部分に指定するのはシェルスクリプトにしておいて、シェルスクリプトの先頭で環境変数の設定を行い、その後いろいろなコマンドを実行するようにしておくのがよいだろう。

でもPlaggerとかをいくつも実行してる場合、いちいちシェルスクリプト用意するのも面倒だよなー。ということで、crontabに環境変数を指定してみた。
参考: suVeneのあれ: crontab 設定の小話

$ crontab -e

行頭に以下を追加。

PERL5LIB=~/Sites/plagger/plagger:~/Sites/plagger/plagger/lib:$PERL5LIB

すると以下の表示。ファイルの保存が出来てない?

crontab: temp file must be edited in place

どうもvimでファイルのバックアップを取る設定になっているのがまずいみたい。
参考: OSXでcrontabの編集が反映されない « ku

普段の設定はCronniX経由でやっているので、根本的な解決はせず一時的に.vimrcの該当行をコメントアウトして回避した。

$ vim .vimrc
":set backup

で、設定してOK。なはずなんだけど、なぜか

/opt/local/bin/perl plagger -c ~/Sites/plagger/fastladder-crawler.yaml

では動かず。

/opt/local/bin/perl ~/Sites/plagger/plagger/plagger -c ~/Sites/plagger/fastladder-crawler.yaml

としてやる必要があった。
なんでだろう。plaggerのパスは通ってるはずなんだけど。

あと /opt/loca/bin/perl も書きたくないなと思って

PATH=/opt/loca/bin:$PATH

とかしても書かないと動かない。せつなさサクレツ。

メモ

cronの設定ファイル直接編集してみたところ、CronniXから変更を加えた際にその部分が消えてしまった。
あちこちの説明を読むと、cronttab -e したり、crontab ~/.crontab したりしているし、直接編集は思想的にNGなのかな?

一応、cronの設定ファイルは(Mac OS X 10.4.11の場合)以下にあるけどいじらない方が良さそう。

$ vim /var/cron/tabs/USERNAME

トラックバック(0)

トラックバックURL: http://retlet.net/cgi-bin/mt5/mt-tb.cgi/26

コメント(132)

I beloved as much as you'll obtain performed right here. The comic strip is attractive, your authored subject matter stylish. however, you command get bought an nervousness over that you would like be handing over the following. ill for sure come more beforehand once more since precisely the similar just about a lot regularly inside case you shield this hike.

Exceptional entry! I found it very intriguing. I'll check back later to see if a lot more posts are added.

What a nice YouTube video it is! Remarkable, I loved it, and I am sharing this YouTube record with all my colleagues.

hello there and thank you in your information – I’ve definitely picked up anything new from right here. I did however experience several technical points the use of this website, since I experienced to reload the site many times previous to I may get it to load correctly. I were pondering if your hosting is OK? Not that I'm complaining, but sluggish loading circumstances times will very frequently impact your placement in google and can injury your high quality score if advertising and ***********|advertising|advertising|advertising and *********** with Adwords. Well I’m including this RSS to my e-mail and can glance out for much more of your respective fascinating content. Make sure you update this once more very soon..

Wow! Its also pleasant article on the topic of JavaScript, I am genuinely keen of learning JavaScript. thanks admin

You must take part in a contest for among the best blogs on the web. I will advocate this site!

Totally composed written content , thanks for data .

Wow, awesome blog layout! How long have you ever been running a blog for? you made blogging glance easy. The full look of your web site is magnificent, let alone the content!

Excellent post, I’m searching forward to hear a lot more from you!!

Wow! It’s a nice jQuery script; I was also seeking for that, so i got it right now from here. Keep it up admin of this site.

Why are so many of the comments on this write-up entirely off topic? You would think everyone has Attention deficit hyperactivity disorder or something, hehe.

I need to have to admit that that is 1 fantastic insight. It surely gives a company the opportunity to have in about the ground floor and truly take part in creating a thing unique and tailored to their needs.

Perfect work you've done, this internet web site is actually cool with great info.

I used to be very happy to seek out this net-site.I needed to thanks in your time for this wonderful learn!! I undoubtedly enjoying each little bit of it and I have you bookmarked to check out new stuff you blog post.

It’s hard to locate knowledgeable folks during this subject, nonetheless, you could be seen as do you know what you are dealing with! Thanks

Well, I do not know if that’s going to work for me, however definitely proved helpful for you! :) Excellent post!

Merely wanna input on couple of general things, The website style is perfect, the subject material is rattling superb : D.

It’s very straightforward to find out any topic on net as compared to books, as I fount this article at this site.

I enjoy you because of each of your labor on this site. Gloria take interest in engaging in investigation and it's simple to grasp why. Almost all notice all about the powerful manner you give reliable thoughts by means of your web blog and attract participation from people about this topic so our favorite princess is actually learning a whole lot. Take pleasure in the rest of the year. You are always carrying out a fantastic job.

This really is the suitable weblog for anybody who needs to seek out out about this topic. You notice so a lot its virtually laborious to argue with you (not that I truly would want…HaHa). You undoubtedly put a brand new spin on a subject thats been written about for years. Fantastic stuff, just fantastic!

There are a handful of fascinating points at some point within the following paragraphs but I do not know if they all center to heart. There exists some validity but Let me take hold opinion until I appear into it further. Wonderful post , thanks and then we want a lot more! Included in FeedBurner at the same time

Truly really very good details internet page. I have to admit that we’re definitely warm the notion

I am extremely impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you customize it yourself? Anyway keep up the excellent quality writing, it’s rare to see a nice blog like this one nowadays..

I am not sure where you're getting your info, but good topic. I needs to spend some time learning more or understanding more. Thanks for magnificent information I was looking for this information for my mission.

Thanks for your exciting article. One other problem is that mesothelioma is generally brought on by the breathing of fibers from mesothelioma, which is a extremely dangerous material. It truly is commonly noticed among laborers in the construction industry who've long contact with asbestos. It could be caused by residing in asbestos protected buildings for a long period of time, Inherited genes plays a crucial role, and some persons are more vulnerable to the risk when compared with others.

An attention-grabbing dialogue is value comment. I believe that it is best to write extra on this matter, it might not be a taboo subject but generally persons are not sufficient to speak on such topics. To the next. Cheers

Hello, you used to write great posts, but the last few posts have been kinda boring... I miss your super writing. Past few posts are just a bit out of track!

The other day, while I was at work, my cousin stole my iPad and tested to see if it can survive a twenty five foot drop, just so she can be a youtube sensation. My iPad is now destroyed and she has 83 views. I know this is completely off topic but I had to share it with someone!

Wow that was unusual. I just wrote an very long comment but after I clicked submit my comment didn't appear. Grrrr... well I'm not writing all that over again. Anyway, just wanted to say superb blog!

Cpr KIts… very fantastic read you know alot about this topic i see!…

I’m not confident exactly why but this web web site is loading extremely slow for me. Is anyone else having this problem or is it a difficulty on my finish? I’ll check back later and see if the issue still exists.

I've not checked in here for a although as I thought it was getting boring, but the last few posts are good quality so I guess Iˇ¦ll add you back to my daily bloglist. You deserve it friend

Superb post. I was checking constantly this blog and I’m impressed! Extremely valuable data specially the last part I care for such info a lot. I was seeking this certain information for a long time. Thank you and best of luck.

I am impressed with this website, extremely I'm a big fan.

Reading, watching movies or plays, or similar activities that may possibly bring inspiration.

Great day! This post could not be written any much better! Reading this post reminds me of my previous room mate! He always kept chatting about this. I will forward this write-up to him. Fairly certain he will have a very good read. Thanks for sharing!

When I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on every time a comment is added I get 4 emails with the exact same comment. Perhaps there is a means you are able to remove me from that service? Cheers!

Hey! This post could not be written any better! Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this page to him. Pretty sure he will have a good read. Many thanks for sharing!

You really make it seem so effortless together with your presentation but I uncover this matter to be truly something which I feel I would never recognize. It seems too complex and really broad for me. I'm searching forward for your next post, I will try to get the hang of it! xrumer

I've to show some thanks to the writer just for bailing me out of such a dilemma. As a result of surfing throughout the online world and coming across strategies that were not beneficial, I believed my entire life was effectively over. Existing minus the solutions towards the difficulties you've got resolved all via the post can be a serious case, and the kind that would have negatively damaged my career if I had not discovered your web page. Your own individual know-how and kindness in playing with every part was tremendous. I’m not positive what I would have done if I hadn’t come upon such a stuff like this. I can also at this moment appear ahead to my future. Thanks extremely much for your specialized and results-oriented help. I won’t be reluctant to suggest your internet site to anybody who needs guide on this subject matter.

Aw, this was a very nice post. In thought I would like to put in writing like this moreover – taking time and actual effort to make a very good article… but what can I say… I procrastinate alot and in no way seem to get one thing done.

This is obtaining a bit a lot more subjective, but I considerably prefer the Zune Marketplace. The interface is colorful, has a lot more flair, and some cool attributes like ‘Mixview’ that let you speedily see related albums, songs, or other users related to what you’re listening to. Clicking on one of those will center on that item, and an additional set of “neighbors” will come into view, allowing you to navigate about exploring by comparable artists, songs, or users. Speaking of users, the Zune “Social” is also excellent fun, letting you find other people with shared tastes and becoming friends with them. You then can listen to a playlist developed based on an amalgamation of what all your friends are listening to, which is also enjoyable. Those concerned with privacy will be relieved to know you'll be able to stop the public from seeing your individual listening habits should you so pick.

I have been looking for that, thanks! I think all of this information are so helpful. Bookmarked, i'll check back later!

I consider something actually particular in this site .

A few things i've seen in terms of laptop or computer memory is that often there are attributes such as SDRAM, DDR etc, that ought to fit in with the specs with the mother board. If the personal computer’s motherboard is reasonably current even though you'll find no operating-system issues, improving the memory literally will take under a couple of hours. It’s one of the easiest computer upgrade types of procedures one can envision. Thanks for sharing your tips.

I would like to consider the ability of thanking you for that expert guidance I've often enjoyed checking out your site. I’m looking forward to the particular commencement of my college research and the entire prep would never have been complete without dropping by your website. If I could be of any assistance to others, I’d personally be glad to help as a result of what I have gained from here.

Hey! I just want to give a huge thumbs up for the nice information you will have here on this post. I will likely be coming again to your blog for more soon.

Outstanding post, you have pointed out some excellent details , I likewise conceive this s a really excellent web site.

Hello! Good post! Please do keep us posted when we can see a follow up!

I was looking for this, thanks! I think all of this helpful info are so helpful. Bookmarked, i'll check back later!