APM: Crontab problem
David Murphy
David at starlightmedia.net
Sun Jun 29 23:02:49 CDT 2003
Using the command give it worked find in console
So I made my cron read like this:
MAILTO="Dbmurphy at austin.rr.com"
SHELL=/bin/sh
PATH=/usr/bin:/bin
PWD=/home/freexxxm
SHLVL=1
HOME=/home/freexxxm
LOGNAME=freexxxm
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Anal-Sex:Tall'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Anal-Sex:Wide'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Blow-Jobs:Tall'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Blow-Jobs:Wide'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Butt-Pics:Tall'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Butt-Pics:Wide'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Cum-Shots:Tall'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Cum-Shots:Wide'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Dick-Pics:Tall'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Dick-Pics:Wide'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Frat-Boys:Tall'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Frat-Boys:Wide'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Jack-Offs:Tall'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Jack-Offs:Wide'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker &&
QUERY_STRING='Muscle-Men:Tall' ./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker &&
QUERY_STRING='Muscle-Men:Wide' ./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Rim:Tall'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Rim:Wide'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Sex-Toys:Tall'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Sex-Toys:Wide'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Twinks:Tall'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Twinks:Wide'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Uniforms:Tall'
./gal.cgi"
*/2 * * * * env -i /bin/sh -c "cd
/home/freexxxm/www/cgi-bin/gallerymaker && QUERY_STRING='Uniforms:Wide'
./gal.cgi"
Does this look correct cus the email I recived was
/bin/sh: line 1: ./gal.cgi
: No such file or directory
-----Original Message-----
From: Wayne Walker [mailto:wwalker at broadq.com]
Sent: Sunday, June 29, 2003 9:48 PM
To: David Murphy
Cc: austin at mail.pm.org
Subject: Re: APM: Crontab problem
On Sun, Jun 29, 2003 at 08:53:51PM -0500, David Murphy wrote:
>
> Im trying to load a script via crontab
>
> The cronttab entry is
>
*/2 * * * * cd /path/to/script && QUERY_STRING='Blah:Blah'
./script.pl
That should do exactly what you want.
in order to test manually rather than wait for cron,:
env -i SHELL=/bin/sh PATH=/usr/bin:/bin PWD=/home/wwalker SHLVL=1
HOME=/home/wwalker LOGNAME=wwalker /bin/sh -c "cd /path/to/script &&
QUERY_STRING='Blah:Blah' ./script.pl"
Your problems are almost certainly environment variables that you expect
to be set that are not. Your user start up files are NOT read by the
shell that cron execs your program with.
Or the misspelliong of the exported variable. in my method, your only
have to type it once.
> Some varations ive tried are
> 1. Putting the command in a sh file and running that
> 2. */2 * * * * QUERY_STRING='Blah:Blah' ; export QUIERY_STRING
;cd
> /path/to/script ; ./script.pl
> 3. */2 * * * * QUERY_STRING='Blah:Blah' ; export QUIERY_STRING
;cd
> /path/to/script ; perl script.pl
> 4. */2 * * * * QUERY_STRING='Blah:Blah' ; export
QUIERY_STRING ;
> perl /path/to/script.pl
> 5. */2 * * * * QUERY_STRING='Blah:Blah' ; export
QUIERY_STRING ;
> /path/to/script.pl
> 6. Writing a Perl script that issue
system(`QUERY_STRING='Blah:Blah'
> ; export QUIERY_STRING ;cd /path/to/script ; ./script.pl')
>
> None of these work but all of these if put into sh or bash run
fine.
>
>
>
> What I get back via a cronemail is variable
>
> But one thing is constant it always in one way or another say
file
> not found
>
> Either sh cant find it or perl cant or bin/sh couldn't find it.
>
>
>
> Anyhelp here would be awesome
>
>
>
> And 0755 is the permissions and owner ship of the file it to the
user
> running the cron.
--
Wayne Walker
www.broadq.com :) Bringing digital video and audio to the living room
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/austin/attachments/20030629/f2effd55/attachment.htm
More information about the Austin
mailing list