Please help me with my cron job. Immense details inside.
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: Please help me with my cron job. Immense details inside.
What does "crontab -l" show?
Re: Please help me with my cron job. Immense details inside.
And, for posterity's sake, here's what my crontab looks like for user jshaw:
[code]
MAILTO=jshaw@michaelrobertvictor.com
07 13 * * * /home/jshaw/retirement_time
[/code]
The file "retirement_time" contains ONLY this:
[code]
/usr/bin/php -f /home/jshaw/retireevents.php
[/code]
[code]
MAILTO=jshaw@michaelrobertvictor.com
07 13 * * * /home/jshaw/retirement_time
[/code]
The file "retirement_time" contains ONLY this:
[code]
/usr/bin/php -f /home/jshaw/retireevents.php
[/code]
Re: Please help me with my cron job. Immense details inside.
[quote]
michaelnel wrote:
Could you please just use the command line and utilities like "ls" instead of pasting all that gui junk into the messages? At least for me, the gui stuff makes it more difficult to read the information.... to the point where I don't want to read it.[/quote]
[code]
[jshaw@thunder ~]$ ls -l /home/jshaw
total 588472
drwxrwxr-x 53 root root 4096 Aug 4 15:08 admin_mrv
-rw-r--r-- 1 jshaw jshaw 0 Jan 22 17:33 cron.log?
-rw-r--r-- 1 jshaw jshaw 63 Jan 26 13:04 crontab.txt
drwxrwxr-x 10 jshaw apache 4096 Feb 12 2009 dc20
-rw-r--r-- 1 root root 19892378 Dec 18 16:52 design_center20090429.sql
-rw-r--r-- 1 root root 22049283 Dec 18 16:52 design_center20090528.sql
drwxr-xr-x 2 jshaw jshaw 4096 Feb 11 2009 Desktop
-rw-r--r-- 1 jshaw jshaw 559351112 Aug 7 17:31 dtheory-retro-12x18.psd
-rw-r--r-- 1 jshaw jshaw 3495 Aug 17 15:07 fdbckmail.php
-rw-r--r-- 1 jshaw jshaw 1536 Aug 17 15:06 opregmail.php
-rw-r--r-- 1 jshaw jshaw 332194 Aug 4 14:32 php_browscap.ini
-rwxr-xr-x 1 root root 303308 Mar 12 2009 php_browscap.ini.bak
-rwxrwxrwx 1 jshaw jshaw 1126 Jan 22 17:48 retireevents.php
-rwxr-xr-x 1 jshaw jshaw 44 Jan 25 11:40 retirement_time
drwxr-xr-x 2 jshaw jshaw 4096 Jul 21 2009 test
[jshaw@thunder ~]$
[/code]
michaelnel wrote:
Could you please just use the command line and utilities like "ls" instead of pasting all that gui junk into the messages? At least for me, the gui stuff makes it more difficult to read the information.... to the point where I don't want to read it.[/quote]
[code]
[jshaw@thunder ~]$ ls -l /home/jshaw
total 588472
drwxrwxr-x 53 root root 4096 Aug 4 15:08 admin_mrv
-rw-r--r-- 1 jshaw jshaw 0 Jan 22 17:33 cron.log?
-rw-r--r-- 1 jshaw jshaw 63 Jan 26 13:04 crontab.txt
drwxrwxr-x 10 jshaw apache 4096 Feb 12 2009 dc20
-rw-r--r-- 1 root root 19892378 Dec 18 16:52 design_center20090429.sql
-rw-r--r-- 1 root root 22049283 Dec 18 16:52 design_center20090528.sql
drwxr-xr-x 2 jshaw jshaw 4096 Feb 11 2009 Desktop
-rw-r--r-- 1 jshaw jshaw 559351112 Aug 7 17:31 dtheory-retro-12x18.psd
-rw-r--r-- 1 jshaw jshaw 3495 Aug 17 15:07 fdbckmail.php
-rw-r--r-- 1 jshaw jshaw 1536 Aug 17 15:06 opregmail.php
-rw-r--r-- 1 jshaw jshaw 332194 Aug 4 14:32 php_browscap.ini
-rwxr-xr-x 1 root root 303308 Mar 12 2009 php_browscap.ini.bak
-rwxrwxrwx 1 jshaw jshaw 1126 Jan 22 17:48 retireevents.php
-rwxr-xr-x 1 jshaw jshaw 44 Jan 25 11:40 retirement_time
drwxr-xr-x 2 jshaw jshaw 4096 Jul 21 2009 test
[jshaw@thunder ~]$
[/code]
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: Please help me with my cron job. Immense details inside.
[quote]
Kinsbane wrote:
...
MAILTO=jshaw@michaelrobertvictor.com
...[/quote]
That's the line you should have obfuscated. :-)
Perhaps it should be[code]
#!/bin/bash
/usr/bin/php -f /home/jshaw/retireevents.php
[/code]
Kinsbane wrote:
...
MAILTO=jshaw@michaelrobertvictor.com
...[/quote]
That's the line you should have obfuscated. :-)
Perhaps it should be[code]
#!/bin/bash
/usr/bin/php -f /home/jshaw/retireevents.php
[/code]
Re: Please help me with my cron job. Immense details inside.
[quote]
pschaff wrote:
[quote]
Kinsbane wrote:
...
MAILTO=jshaw@michaelrobertvictor.com
...[/quote]
That's the line you should have obfuscated. :-)
Perhaps it should be[code]
#!/bin/bash
/usr/bin/php -f /home/jshaw/retireevents.php
[/code][/quote]
Hehe, I don't work for michaelrobertvictor.com
Oh well.
The cron will run in 3 minutes so we'll see what happens!
pschaff wrote:
[quote]
Kinsbane wrote:
...
MAILTO=jshaw@michaelrobertvictor.com
...[/quote]
That's the line you should have obfuscated. :-)
Perhaps it should be[code]
#!/bin/bash
/usr/bin/php -f /home/jshaw/retireevents.php
[/code][/quote]
Hehe, I don't work for michaelrobertvictor.com
Oh well.
The cron will run in 3 minutes so we'll see what happens!
Re: Please help me with my cron job. Immense details inside.
:(
Still this error:
[quote]
/bin/sh: /home/jshaw/retirement_time
: No such file or directory
[/quote]
/home/jshaw/retirement_time contains this:
[code]
#!/bin/bash
/usr/bin/php -f /home/jshaw/retireevents.php
[/code]
Oh well. It was a nice feature to think about, looks like we don't get to use it though and I can still be everyone else's clean up guy.
Thanks again for everyone's help. I really do appreciate it.
Still this error:
[quote]
/bin/sh: /home/jshaw/retirement_time
: No such file or directory
[/quote]
/home/jshaw/retirement_time contains this:
[code]
#!/bin/bash
/usr/bin/php -f /home/jshaw/retireevents.php
[/code]
Oh well. It was a nice feature to think about, looks like we don't get to use it though and I can still be everyone else's clean up guy.
Thanks again for everyone's help. I really do appreciate it.
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: Please help me with my cron job. Immense details inside.
We're missing something (probably obvious when one sees it). This really [b]ought[/b] to work. I use cron jobs all the time, so this [i]should[/i] be easy. :-x :evil: :-?
Re: Please help me with my cron job. Immense details inside.
[quote]
pschaff wrote:
We're missing something (probably obvious when one sees it). This really [b]ought[/b] to work. I use cron jobs all the time, so this [i]should[/i] be easy. :-x :evil: :-?[/quote]
I also just found out I can't install gnome-schedule. I wanted to try and setup these tasks to run automatically through a GUI scheduler which works with crontab.
Do you know of any others available for CentOS?
pschaff wrote:
We're missing something (probably obvious when one sees it). This really [b]ought[/b] to work. I use cron jobs all the time, so this [i]should[/i] be easy. :-x :evil: :-?[/quote]
I also just found out I can't install gnome-schedule. I wanted to try and setup these tasks to run automatically through a GUI scheduler which works with crontab.
Do you know of any others available for CentOS?
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: Please help me with my cron job. Immense details inside.
Sorry - the closest I have come to a GUI scheduler is[code]
export EDITOR=emacs
crontab -e
[/code]
:-)
export EDITOR=emacs
crontab -e
[/code]
:-)
Re: Please help me with my cron job. Immense details inside.
Well, I found the solution, although it IS a bit weird!
I was reading this article:
http://net.tutsplus.com/tutorials/other/scheduling-tasks-with-cron-jobs/
And I noticed the part about the bracket ( > ) to write to a log file. I changed the PHP file to not have the hash-bang declaration in the beginning, and put the parser path in the cronjob line instead. So now, my cron job looks like this:
[code]
40 11 * * * /usr/bin/php /home/jshaw/retireevents.php >> /home/jshaw/cron.log
[/code]
And I just got an email from the PHP script, meaning it ran like it should!
I guess the cronjobber was looking for a bracket or two to signify the end of the file/path declaration.
I was reading this article:
http://net.tutsplus.com/tutorials/other/scheduling-tasks-with-cron-jobs/
And I noticed the part about the bracket ( > ) to write to a log file. I changed the PHP file to not have the hash-bang declaration in the beginning, and put the parser path in the cronjob line instead. So now, my cron job looks like this:
[code]
40 11 * * * /usr/bin/php /home/jshaw/retireevents.php >> /home/jshaw/cron.log
[/code]
And I just got an email from the PHP script, meaning it ran like it should!
I guess the cronjobber was looking for a bracket or two to signify the end of the file/path declaration.