Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-11-2006, 11:56 PM   #1
marketsmart
HOMICIDAL TROLL KILLER
 
Industry Role:
Join Date: Dec 2004
Location: Sunnybrook Institution for the Criminally Insane
Posts: 20,419
Cronjob help please

0,30 * * * * /var/www/virtual/domain.com/htdocs/catcher

thatsd what i have. not working. catcher is a script that i want to run every 30 minutes. i chmod the script to 755 already...

can anyone help...

#!/bin/sh
#start
cd /var/www/virtual/domain.com/htdocs
wget http://www.domain.net/master.txt
cat /var/www/virtual/domain.com/htdocs/master.txt >> /var/www/virtual/domain.com/htdocs/mastercomp.txt
#end

thats the script i need to run. basically it pulls a .txt from a location and appends the mastercomp.txt

any help appreciated....
marketsmart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 12:03 AM   #2
marketsmart
HOMICIDAL TROLL KILLER
 
Industry Role:
Join Date: Dec 2004
Location: Sunnybrook Institution for the Criminally Insane
Posts: 20,419
bump init.d....
marketsmart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 12:16 AM   #3
marketsmart
HOMICIDAL TROLL KILLER
 
Industry Role:
Join Date: Dec 2004
Location: Sunnybrook Institution for the Criminally Insane
Posts: 20,419
bump sudo su -.....
marketsmart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 12:34 AM   #4
marketsmart
HOMICIDAL TROLL KILLER
 
Industry Role:
Join Date: Dec 2004
Location: Sunnybrook Institution for the Criminally Insane
Posts: 20,419
www.bump.com

wtf.. i know all the admins arent in vegas.... mine is sleeping and wont wake up...
marketsmart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 12:52 AM   #5
marketsmart
HOMICIDAL TROLL KILLER
 
Industry Role:
Join Date: Dec 2004
Location: Sunnybrook Institution for the Criminally Insane
Posts: 20,419
one last bump...
marketsmart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 12:57 AM   #6
duckduckgoose
Registered User
 
Industry Role:
Join Date: Mar 2006
Location: North Pole
Posts: 82
what do your cron logfiles say? check /var/log/cron (or similar location on your system). this will tell you whether it is a problem with the script itself, or what.

does the script run and work correctly when you run it by hand?
__________________
rRhino.com ...social networking for book fans...
duckduckgoose is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:06 AM   #7
marketsmart
HOMICIDAL TROLL KILLER
 
Industry Role:
Join Date: Dec 2004
Location: Sunnybrook Institution for the Criminally Insane
Posts: 20,419
./catcher: /bin/sh^M: bad interpreter: No such file or directory
thats what i just got when i tried to run it manuelly....
marketsmart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:08 AM   #8
MattX
Registered User
 
Join Date: Jan 2006
Posts: 6
Mostly a lurker, but figured id help.

30 * * * * /path/whateveryouwanttorun

Will run that script every 30 minutes. Remove that 0, you have.

Goes min, hour, day of month, month, day of week.
MattX is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:15 AM   #9
duckduckgoose
Registered User
 
Industry Role:
Join Date: Mar 2006
Location: North Pole
Posts: 82
If i'm not mistaken, the 30 alone means it will run at :30 of every hour, day, etc. His intention seems originally to run it every half hour, meaning at :00 and :30.

also, the message "bad interpreter: No such file or directory" in this situation usually means you don't have that shell installed. Try putting /bin/bash instead and see if it runs manually then. Some systems just don't have the original Bourne shell installed anymore.
__________________
rRhino.com ...social networking for book fans...

Last edited by duckduckgoose; 07-12-2006 at 01:16 AM..
duckduckgoose is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:21 AM   #10
MattX
Registered User
 
Join Date: Jan 2006
Posts: 6
Sorry, hes right. take 4:30am advice for what it is. Your original cron will run every 30 minutes.

problem is just your shell.. see if its even there, most likely just linked to bash. swap or fix, should be fine then.
MattX is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:26 AM   #11
marketsmart
HOMICIDAL TROLL KILLER
 
Industry Role:
Join Date: Dec 2004
Location: Sunnybrook Institution for the Criminally Insane
Posts: 20,419
Quote:
Originally Posted by duckduckgoose
If i'm not mistaken, the 30 alone means it will run at :30 of every hour, day, etc. His intention seems originally to run it every half hour, meaning at :00 and :30.

also, the message "bad interpreter: No such file or directory" in this situation usually means you don't have that shell installed. Try putting /bin/bash instead and see if it runs manually then. Some systems just don't have the original Bourne shell installed anymore.
that didnt seem to help.. still got same error...
marketsmart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:29 AM   #12
marketsmart
HOMICIDAL TROLL KILLER
 
Industry Role:
Join Date: Dec 2004
Location: Sunnybrook Institution for the Criminally Insane
Posts: 20,419
/bash is in /bin and /sh is linked to /bash....
marketsmart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:31 AM   #13
marketsmart
HOMICIDAL TROLL KILLER
 
Industry Role:
Join Date: Dec 2004
Location: Sunnybrook Institution for the Criminally Insane
Posts: 20,419
is it possible that i need to drop the script in cgi-bin or outside of htdocs?
marketsmart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:33 AM   #14
duckduckgoose
Registered User
 
Industry Role:
Join Date: Mar 2006
Location: North Pole
Posts: 82
the first line in the script is often called the "bang line", and it points to the shell used to execute the script. if the two shell location paths you have tried so far (/bin/sh and /bin/bash) don't work, you need to determine which shells are available to be used, and where they are located on your system.

check other existing working scripts on the same system to determine the shell they are using, and then try using the same shell and location in your script here.
__________________
rRhino.com ...social networking for book fans...
duckduckgoose is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:45 AM   #15
marketsmart
HOMICIDAL TROLL KILLER
 
Industry Role:
Join Date: Dec 2004
Location: Sunnybrook Institution for the Criminally Insane
Posts: 20,419
thanks for all your help guys.. it was the script. i uploaded it from my box and it was seeing it incorrectly. i manually added the script through vi and its working now...
marketsmart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:47 AM   #16
fuzebox
making it rain
 
fuzebox's Avatar
 
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,114
An easy fix would be to change your cron line to this:

0,30 * * * * sh /var/www/virtual/domain.com/htdocs/catcher
fuzebox is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:49 AM   #17
fuzebox
making it rain
 
fuzebox's Avatar
 
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,114
Ah, so the real problem was probably hidden line break characters then... What are you using to edit files?
fuzebox is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 01:53 AM   #18
marketsmart
HOMICIDAL TROLL KILLER
 
Industry Role:
Join Date: Dec 2004
Location: Sunnybrook Institution for the Criminally Insane
Posts: 20,419
Quote:
Originally Posted by fuzebox
Ah, so the real problem was probably hidden line break characters then... What are you using to edit files?
TextPad which is normally good and has no issues.. i must have missed something... thanks for all the help the advice helped me rule out other problems and got the brain going...
marketsmart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 03:44 AM   #19
jimthefiend
So Fucking Banned
 
Join Date: Oct 2003
Location: icq: 121189
Posts: 18,889
I could help you but I won't.
jimthefiend is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-12-2006, 06:13 AM   #20
drjones
Confirmed User
 
Join Date: Oct 2005
Location: Charlotte, NC
Posts: 908
Quote:
Originally Posted by marketsmart
TextPad which is normally good and has no issues.. i must have missed something... thanks for all the help the advice helped me rule out other problems and got the brain going...

Textpad will save the files in windows format wich uses ^M for carriage returns. Since linux/unix doesnt recognize ^M as a carriage return it will give you problems. Most linux distros usually come with two handy little tools for this situation.. remember these

dos2unix
unix2dos
__________________
ICQ: 284903372
drjones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.