Problem:
For some reasons i was not able to run the script having file handling functions from crontab, after few experiments on how to run the php script having file handling functions as cron job, have come up with the solution.


script.php
<?php

$fp = fopen(‘expireddaterange.txt’, ‘r’);
$file = file_get_contents(‘expireddaterange.txt’);

if(strlen($file) > 0){
….
}else{
echo ‘File[expireddaterange.txt] is Empty';
exit;
}
?>
expireddaterange.txt contains:
20120206000000,20120221000000

when i run the php script from terminal

[root@xxxx ]# php script.php
the script executed porperly, but when the same script made as cron job entry,

[root@xxxx ]# crontab -e
35 14 * * * /usr/bin/php -d include_path=.:/full path of the script/script.php

And when the script, script.php executed at 2:35 pm, the script was throwing message  “File[expireddaterange.txt] is Empty”, ie., cursor has fall in else part,

Solution:
For this to work, i made changes in the script.php
<?php

$fp = fopen(‘/full path/expireddaterange.txt’, ‘r’, true);
$file = file_get_contents(‘/full path/expireddaterange.txt’, true);
if(strlen($file) > 0){

….
}else{
echo ‘File[expireddaterange.txt] is Empty';
exit;
}
?>

give permission to the file expireddaterange.txt

[root@xxxx ]# chmod 666 /full path/expireddaterange.txt

And the next time the crontab entry

35 14 * * * /usr/bin/php -d include_path=.:/full path of the script/script.php

will work.

about the author

ravim

  • http://hair123.exblog.jp/17433416/ brazilian virgin hair extension

    This very blog is really educating and informative. I have chosen helluva interesting tips out of it. I’d love to return again soon. Thanks a bunch!

  • http://serenity-house1.org/iiiie889 Deandre Sherrell

    Enormously educational many thanks, I do believe your visitors will very likely want further blog posts such as this maintain the excellent effort.

  • http://baseswiki.org/en/Index.php More Help

    Hurrah, that’s what I was exploring for, what a data! existing here at this blog, thanks admin of this web site.

  • http://urwij.pl/konstrukcjebudowlane konstrukcje budowlane

    My mother used to give me the exact same advice

  • http://www.nmepodium.nl/ms_wiki/ ikea mattress topper australia

    I feel other blog site owners should really give some thought to this important webpage as a model. Definitely clean and convenient approach, and moreover superior website content! You are very skilled when it comes to this valuable topic :)

  • facebook password hacker downloads

    Hello there! This is kind of off topic but I need some guidance from an established blog. Is it difficult to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about making my own but I’m not sure where to begin. Do you have any points or suggestions? Thank you

  • http://www.scseet.com/Shownews.asp?id=23633 best seo company

    I simply desired to thank you very much once more. I do not know the things I could possibly have undertaken in the absence of the type of suggestions contributed by you over this subject matter. It truly was a terrifying crisis in my opinion, but taking a look at a specialized manner you resolved that forced me to cry over gladness. Extremely happy for the support and thus pray you really know what a great job you are doing training the others with the aid of a site. I’m certain you haven’t got to know any of us.

  • http://www.aronatic.com san diego aronatic

    What¡¦s Happening i’m new to this, I stumbled upon this I’ve located It positively helpful and it has aided me out loads. I’m hoping to provide a contribution & aid different customers like its aided me. Good job.

  • http://eliquidwholesale.blogspot.co.uk/ {e liquid|eliquid|e liquid uk|eliquids|e liquids|electronic cigarettes|electronic cigarettes e liquid | ejuice | e juice}

    Hi! This is kind of off topic but I need some help from an established blog. Is it hard to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about creating my own but I’m not sure where to start. Do you have any ideas or suggestions? Cheers

  • https://www.prbuzz.com/personal-finance/113886-ada-research-shows-dental-spending-down.html Leslee Fehribach

    For reasons unknown, the words are broken on this blog

  • http://gotowkowepozyczki.jux.com pożyczka dla każdego

    I needed to post you the very small word just to say thanks a lot over again for these superb methods you have documented in this case. It was shockingly open-handed of people like you giving publicly what exactly a number of people would’ve made available as an electronic book to make some money on their own, specifically now that you could have done it if you wanted. These good ideas likewise served like the great way to know that most people have the same dreams the same as mine to realize a great deal more pertaining to this problem. I know there are a lot more pleasant times in the future for individuals who browse through your blog post.

  • http://podroznik.juzwiem.eu/aminokwasy-stosowane-podczas-treningow_59a Morgan Trinka

    Some really interesting details you have written. Assisted me a lot, just what I was looking for : D.

  • http://pedrohudg.autisable.com/773106517/what-you-can-do-yourself-to-make-landscaping/ gridforce ground reinforcement

    What’s up to all, as I am truly eager of reading this blog’s post to be updated on a regular basis. It carries fastidious information.

  • http://ljetne-gume.webs.com/ ljetne gume

    I like what you guys are usually up too. Such clever work and coverage! Keep up the amazing works guys I’ve you guys to blogroll.

  • http://www.qke.name/internet/kino-dla-elen/ Zwiastuny filmowe – Film dla Elen

    You actually make it appear so easy with your presentation but I find this topic to be actually something which I think I might by no means understand. It seems too complex and extremely extensive for me. I am looking ahead in your subsequent post, I will attempt to get the hang of it!

  • https://online.hiram.edu/mahara/view/view.php?id=1464 phentermine

    Hello, i just planned to drop that you a line to say that we thoroughly enjoyed this particular post from yours, I have subscribed for your RSS feed and have absolutely skimmed several of your articles or blog posts before but this blog really endured out in my situation.

  • http://zdrowie24.cba.pl/strona35.html Carli Riemersma

    I am glad to be one of many visitors on this great site (:, appreciate it for putting up.

  • http://local.yahoo.com/info-73597963-law-offices-of-jesus-r-lopez-san-antonio san antonio bail bonds

    Immediately after representation whatsoever of your blogposts I moldiness say i pioneer this particularised one to typically be prime nick. I mortal a weblog also and essential to repost some shear of one’s articles on my personal diary tract. Must it be alright if I use this as daylong I private reference your web diary or generate a incoming linkage for your article I procured the snipping from? If not I make and could not do it with out getting your tolerance . I hump collection starred this short article to cheep and zynga calculate motivated for publication. Anyway revalue it either way!

  • http://www.premiertaxfree.com/index.php/member/34095/ relevant page

    Generally I do not learn article on blogs, but I wish to say that this write-up very pressured me to take a look at and do it! Your writing taste has been amazed me. Thanks, very nice article.

  • http://pagez.priv.pl/dieta-south-beach/ Jonie Charland

    I wanted to check up and allow you to know how , a great deal I loved discovering your blog today. I would consider it a honor to operate at my office and be able to utilize the tips provided on your web-site and also be a part of visitors’ reviews like this. Should a position connected with guest article author become offered at your end, please let me know.

  • http://www.milfcamssex.com/ milfcams

    I loved this interview so much. I once read in another interview you did, you said, Every color matches. That has always stuck with me and have since sort of adopted it.

  • http://www.sellmyhouseonline.com.au/index.php?action=page_display&PageID=1 Selling My House

    Very easily, the post is seriously the greatest on this laudable topic. I concur together with your conclusions and can thirstily watch forward to your future updates. Saying cheers will not just be enough, for the wonderful c lucidity in your writing. I will instantly grab your rss feed to stay privy of any updates. Solid perform and much achievement within your small business enterprise!

  • http://s223490877.online.de/2013/05/29/uciekinier-w-kinach/ fajny film 2011 zapytaj

    What’s Taking place i’m new to this, I stumbled upon this I have originate It absolutely beneficial and it has aided me outdated loads. I’m hoping to contribute & aid several users comparable its aided me. Abundant job.

  • http://www.nikehumanrace.pl/katalog/firmy-wg-branz/budownictwo/stropy-teriva.html Louie Prence

    you’re in point of fact a good webmaster. The web site loading pace is amazing. It seems that you are doing any unique trick. Also, The contents are masterpiece. you have performed a magnificent job in this topic!

  • http://www.google144.com/Osasdfddd Modesto Metcalfe

    I simply can not find a place here to order a subscribtion to “Letters in the Mail” for the present or two and also for myself.
    It sounds like a wonderful idea and several of my buddies is going to be delighted to receive letters in the mail….
    Diane

  • http://www.viagra.gd viagra online without prescription

    Advantageously, typically the submit is really the very best about this laudable theme. To be sure with all your a conclusion and will thirstily await the following revisions. Really stating cheers won’t only end up being suitable, to your good readability within your creating. I may at once seize a person’s rss to sleep in abreast of virtually any upgrades. Fine job and much success within your organization business!

  • http://www.ykk3499.com/uZzxdc3l Leena Jefferson

    Once i retire I’d adore to move to Hawaii.

  • http://www.arts.czest.pl Tracey Novielli

    wonderful put up, very informative. I wonder why the other specialists of this sector do not notice this. You should proceed your writing. I am confident, you’ve a huge readers’ base already!

  • http://www.communitywalk.com/user/view/2182418 Branden Klingen

    I will immediately snatch your rss feed as I can’t find your e-mail subscription link or e-newsletter service. Do you’ve any? Please allow me understand so that I could subscribe. Thanks.

  • http://vimeo.com/user19483210 Tom Vanwyck

    I’m extremely impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you modify it yourself? Either way keep up the nice quality writing, it’s rare to see a great blog like this one today

  • http://www.breakfastchoices.moonfruit.com Eli Pila

    Inspiring I can absolutely say that this blog was inspired. If you want a 5th look contact me.

  • http://briansemrad.com/netbeans-and-eclipse-setup-for-ubuntu-12-04-unity/ Cesar Brownstein

    Attractive section of content. I just stumbled upon your site and in accession capital to assert that I acquire in fact enjoyed account your blog posts. Anyway I抣l be subscribing to your feeds and even I achievement you access consistently quickly.

  • http://friendfeed.com/cindynebraska Sol Kemler

    It�s laborious to seek out knowledgeable individuals on this matter, but you sound like you already know what you�re talking about! Thanks

  • http://www.khaces.com/tp-khaces-115c04tp-khaces-115c04-boston-office-space-furnished-amp-staffed-888-690-2310-office-space-boston-ma/5639567 Marg Palenzuela

    I�m impressed, I need to say. Really not often do I encounter a blog that�s both educative and entertaining, and let me inform you, you might have hit the nail on the head. Your concept is outstanding; the difficulty is something that not enough individuals are speaking intelligently about. I am very completely happy that I stumbled across this in my search for something referring to this.

  • http://www.journalhome.com/thaliabaumann/437457/urgent-usb-flash-drive-recovery.html Read Even more

    Hi! This post could not be written any better! Reading through this post reminds me of my old room mate! He always kept talking about this. I will forward this write-up to him. Fairly certain he will have a good read. Many thanks for sharing!

  • http://cursos-inem.blogspot.com/2013/03/cursos-para-desempleados-de-formacion.html inem

    Wow! This can be one unique of the very beneficial sites We have ever arrive across on this matter. Actually Excellent. I am also an expert in this subject Therefore I can understand your Effort.

  • http://www.everytrail.com/profile.php?user_id=1668060 Adam Donegan

    There are actually a variety of particulars like that to take into consideration. That could be a nice point to bring up. I provide the thoughts above as normal inspiration but clearly there are questions like the one you carry up the place a very powerful thing will probably be working in trustworthy good faith. I don?t know if finest practices have emerged round issues like that, however I am positive that your job is clearly recognized as a fair game. Each girls and boys really feel the impact of only a second’s pleasure, for the remainder of their lives.

  • http://www.fiql.com/members/Jennifermiss Young Molander

    I loved up to you will obtain performed proper here. The comic strip is attractive, your authored material stylish. nonetheless, you command get got an nervousness over that you want be delivering the following. ill without a doubt come more previously once more since exactly the similar nearly a lot steadily inside of case you protect this increase.

  • https://www.facebook.com/andrew.dong.526/posts/202485119911846 recording

    We stumbled over here by a distinct web page and thought I could examine things out. I like what I see so now i’m following you. Appear forward to acquiring out about your net page to get a second time.

  • http://radiolinkfm.com/2013/07/16/gdzie-zyskac-meble-nierdzewne-tanie-i-swietne/ www

    Thanks for your submission. I also believe laptop computers are becoming more and more popular these days, and now are often the only kind of computer utilized in a household. Simply because at the same time potentially they are becoming more and more reasonably priced, their computing power keeps growing to the point where they may be as effective as pc’s out of just a few years back.

  • http://rosenlundpark.com/adorn-your-house-with-these-an-advice/ Gardening

    Wow, awesome weblog format! How long have you ever been blogging for? you made blogging look easy. The full look of your web site is great, let alone the content!

  • http://www.aafa-ca.net/advice-meant-for-web-design-a-superb-websites/ design web hosting

    Good info and right to the point. I am not sure if this is in fact the best place to ask but do you folks have any thoughts on where to employ some professional writers? Thank you :)

  • http://gotothailand.info/ High

    hello there and thank you for your info – I have definitely picked up anything new from right here. I did however expertise a few technical points using this site, since I experienced to reload the web site many times previous to I could get it to load properly. I had been wondering if your hosting is OK? Not that I am complaining, but sluggish loading instances times will sometimes affect your placement in google and can damage your high-quality score if ads and marketing with Adwords. Anyway I’m adding this RSS to my e-mail and could look out for much more of your respective exciting content. Make sure you update this again very soon..

  • http://hipoteczki.canalblog.com Branden Schearer

    hello there and thank you for your information – I’ve definitely picked up something new from right here. I did however expertise a few technical points using this website, since I experienced to reload the web site many times previous to I could get it to load correctly. I had been wondering if your hosting is OK? Not that I’m complaining, but slow loading instances times will sometimes affect your placement in google and can damage your quality score if ads and marketing with Adwords. Well I’m adding this RSS to my e-mail and could look out for a lot more of your respective intriguing content. Make sure you update this again very soon..

  • http://thesafespothouston.com/profiles/blogs/the-most-useful-doctors-notes-available-on printable doctors note

    I drop a leave a response each time I especially enjoy a article on a site or I have something to contribute to the conversation. It is a result of the sincerness communicated in the article I read. And after this post %BLOG_TITLE%. I was excited enough to drop a thought :-) I actually do have a couple of questions for you if you do not mind. Is it just me or do a few of these comments come across as if they are left by brain dead visitors? 😛 And, if you are posting at additional places, I would like to keep up with you. Would you make a list every one of all your shared pages like your Facebook page, twitter feed, or linkedin profile?

  • http://sierratelehealth.org/public-health-enhancing-childrens-health-through-incorporated-public-health-along-with-pediatric-medicine.html/public-health Eye Health

    Very nice info and straight to the point. I am not sure if this is truly the best place to ask but do you folks have any ideea where to hire some professional writers? Thanks :)

  • http://portclydefish.com/ pinnacle dog food

    I simply couldn’t depart your web site prior to suggesting that I really loved the standard info a person supply for your guests? Is going to be again frequently to investigate cross-check new posts

  • http://www.everytrail.com/profile.php?user_id=1725935 Velda Burditt

    I likewise think so , perfectly pent post! .

  • http://www.fundeducationnowfl.net/college-cause-it-finished-zooming-designs/ childhood education education

    You really make it appear so easy with your presentation however I in finding this topic to be actually one thing which I think I would never understand. It sort of feels too complex and extremely extensive for me. I’m taking a look forward in your next post, I¡¦ll try to get the hang of it!

  • http://web-design-zurich.com/how-you-can-find-a-web-hosting-easily-and-also-fairly-quickly/ engine optimization victory

    Good blog! I really love how it is easy on my eyes and the data are well written. I’m wondering how I could be notified whenever a new post has been made. I’ve subscribed to your feed which must do the trick! Have a nice day!

  • http://tommybmkn.polyvore.com Jan Drenner

    Some genuinely good information, Sword lily I noticed this.

  • http://www.termyspa.pl Broderick Mooe

    I just like the helpful information you provide on your articles. I will bookmark your blog and test again right here regularly. I am somewhat sure I’ll learn plenty of new stuff right here! Best of luck for the next!

  • http://support.mozilla.org/en-US/user/936995 Jonathan Eschborn

    You actually make it appear really easy along with your presentation however I in finding this matter to be really something that I think I might never understand. It sort of feels too complicated and very wide for me. I am taking a look forward in your subsequent publish, I will attempt to get the hold of it!

  • http://www.art.studioszymon.pl Dominic Ravo

    Have you ever thought about publishing an e-book or guest authoring on other blogs? I have a blog based upon on the same information you discuss and would love to have you share some stories/information. I know my readers would appreciate your work. If you’re even remotely interested, feel free to send me an e mail.

  • http://www.senselock.com/en/pckii/professional-mini-version software protection dongle

    Yeah bookmaking this wasn’t a bad determination good post! .

  • http://twojstatus.pl/ twojstatus.pl

    Wonderful web site. Lots of helpful information here. I’m sending it to a few pals ans also sharing in delicious. And of course, thanks in your sweat!

  • http://www.civilatbrunel.com/ lumene skin care

    Helpful information. Lucky me I discovered your web site by accident, and I’m stunned why this accident didn’t happened in advance! I bookmarked it.

  • http://tkotonymack.com/ black men skin care

    You really make it seem really easy with your presentation however I in finding this topic to be actually something that I believe I might by no means understand. It seems too complex and very large for me. I’m having a look ahead to your subsequent put up, I will attempt to get the cling of it!

  • http://uszwbc.com/ muscle

    Great write-up, I am normal visitor of one¡¦s blog, maintain up the excellent operate, and It is going to be a regular visitor for a lengthy time.

  • http://svet-domen.com/ automobile cup holders

    I’ve been browsing on-line greater than three hours as of late, but I by no means discovered any fascinating article like yours. It¡¦s beautiful worth sufficient for me. In my view, if all site owners and bloggers made good content as you probably did, the internet might be a lot more useful than ever before.

  • http://gomasvili.seesaa.net/article/370306350.html lamia

    Thanks used for another informative place. Everyplace else might I get that kindly of info printed in such a great way? I’ve a project that I’m just at this moment functioning on

  • http://www.youtube.com/watch?v=p2HLosrBdDo cawk

    doggin