Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 932593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:41:40+00:00 2026-05-15T20:41:40+00:00

I need this cron job to execute my shell just as it does when

  • 0

I need this cron job to execute my shell just as it does when I run it on the command line.

I read through the one other question I found about this, but my console-based cron job still is not working. I want to post some code and what it outputs, maybe someone can tell me what’s going on.

First off, this is on Cake 1.3. I am running on Ubuntu 9.10. I have tried the shell-script method described in the Cake Book.

I have NOT established any special user account for running the script. The cake console is on my PATH (for the ubuntu built-in user).

In another question I found, they report that the -app parameter isn’t doing anything. This seems to be the case for me as well.

My shell works as it should when I run this from the command line:

./vendors/cakeshell subscription_reminder -cli /usr/bin -app /var/www/www.example.org/htdocs/app -console /var/www/www.example.org/htdocs/cake/console/cake

the output from this looks like:

Welcome to CakePHP v1.3.2 Console
---------------------------------------------------------------
App : app
Path: /var/www/www.directory.sdcweb.org/htdocs/app
---------------------------------------------------------------

I’m logging my cron-job output to a file and the output of that looks different, like this:

EDIT: i’ve noticed that this following code block is just the cake shell script that comes with CakePHP, if you open up cake/console/cake in a text editor you should find the following script.

################################################################################
#
# Bake is a shell script for running CakePHP bake script
# PHP versions 4 and 5
#
# CakePHP(tm) :  Rapid Development Framework (http://cakephp.org)
# Copyright 2005-2010, Cake Software Foundation, Inc.
#
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
#
# @copyright            Copyright 2005-2010, Cake Software Foundation, Inc.
# @link                         http://cakephp.org CakePHP(tm) Project
# @package                      cake
# @subpackage           cake.cake.console
# @since                                CakePHP(tm) v 1.2.0.5012
# @license                      MIT License (http://www.opensource.org/licenses/mit-license.php)
#
################################################################################
LIB=${0/%cake/}
APP=`pwd`

exec php -q ${LIB}cake.php -working "${APP}" "$@"

exit;

My crontab looks like this:

41 20 * * * /var/www/www.example.org/htdocs/app/vendors/cakeshell subscription_reminder -cli /usr/bin -app /var/www/www.example.org/htdocs/app -console /var/www/www.example.org/htdocs/cake/console/cake >> /home/ubuntu/cron-log
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T20:41:41+00:00Added an answer on May 15, 2026 at 8:41 pm

    Well, after a bit more work on this I finally arrived at a crontab which does what I want. It looks like this:

    35 01 * * * cd /var/www/www.example.org/htdocs/app; ../cake/console/cake subscription_reminder
    

    Not only does it work, but it is also a lot more readable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a cron job to check email accounts and download certain attachments. This
I need to add a cron job thru a script I run to set
I need a cron job to run on every 15 mins in every weekday
I have a cron job I need to run every 7 days to aggregate
I am just trying to run a PHP script using a cron job within
I need to set up a cron job that runs an executable compiled using
I have cron job - php script which is called one time in 5
I need to make a bot who can automatically add a cron job for
I'm trying to run a cron job so that a php script will run
I need to write a cron job which hits a url once every day.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.