IMPORTANT!

Snipt is going open source. We've toyed with this idea for quite a while, and have finally decided it's the right way to move forward.

A few things:
  • The entire Snipt source code will be released on GitHub under the 3-clause BSD License on Friday, September 10th.
  • While we'd like to think we're perfect, we realize we're only human. By open sourcing the software that runs this website, certain bugs or security flaws may be discovered that could compromise the privacy of your snipts.
  • Only the Lion Burger team will be able to push commits to the Snipt.net site. Contributors should send a pull request to add new features or submit patches.
  • By using this site, you agree not to be too angry or take any legal action against Lion Burger should this whole thing go up in flames some day.
  • Follow us on Twitter for updates.
I agree, close this message
Sign up to create your own snipts, or login.

Latest 100 public snipts » robertbanh's snipts » cron The latest cron snipts from robertbanh.

showing 1-3 of 3 snipts for cron
  • Cron template file
    <?php
    // ===================
    // Cron script: 
    //
    // Author: Robert Banh
    // Date: 
    // ===================
    set_time_limit(0);
    $currTime = date("F j, Y, g:i:sa");
    echo "========================\r\n";
    echo "Cron: \r\n";
    echo "Job started: $currTime\r\n";
    echo "========================\r\n";
    
    // ===================
    // libs
    // ===================
    $path = '/home/user/';
    require_once($path . 'db.php');
    require_once($path . 'dbFacade.php');
    
    // ===================
    // mysql init
    // ===================
    $dbFacade = new dbFacade();
    $x= $dbFacade->blah();
    echo "-- Total items: " . count($x) . "\r\n\r\n";
    
    
    // =======================================
    $currTime = date("F j, Y, g:i:sa");
    echo "\r\n========================\r\n";
    echo "Job finished: $currTime\r\n";
    ?>
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Apr 16, 2010 at 10:41 a.m. EDT
  • Cron job example
    # This will kick off a cron job at 2:07am.
    
    which $EDITOR
    EDITOR=vi
    export EDITOR
    
    crontab -e
    
    MAILTO="bbb@bbb.com"
    7 2 * * * /usr/local/bin/php -f /home/bbb/cron.php
    
    
    crontab -l
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Feb 17, 2010 at 2:45 p.m. EST
  • linux AT command
    // linux at command
    
    > at 03:30 -v
    > nohup php -f /x/x/x.php > /x/x/logs
    > nohup php -f /rg/repos/trunk/import/importxx-2009.php > ~rbanh/importlogs2009
    > (Ctrl+D)
    > atq    // to view queue
    > atrm 1 // cancel job 1
    > at 1am tomorrow -v // tomorrow 1am
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Nov 08, 2009 at 7:39 p.m. EST
Sign up to create your own snipts, or login.