GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Cronjob help please (https://gfy.com/showthread.php?t=632335)

marketsmart 07-11-2006 11:56 PM

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 07-12-2006 12:03 AM

bump init.d....

marketsmart 07-12-2006 12:16 AM

bump sudo su -.....

marketsmart 07-12-2006 12:34 AM

www.bump.com

wtf.. i know all the admins arent in vegas.... mine is sleeping and wont wake up... :(

marketsmart 07-12-2006 12:52 AM

one last bump... :(

duckduckgoose 07-12-2006 12:57 AM

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?

marketsmart 07-12-2006 01:06 AM

./catcher: /bin/sh^M: bad interpreter: No such file or directory
thats what i just got when i tried to run it manuelly....

MattX 07-12-2006 01:08 AM

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.

duckduckgoose 07-12-2006 01:15 AM

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.

MattX 07-12-2006 01:21 AM

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.

marketsmart 07-12-2006 01:26 AM

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 07-12-2006 01:29 AM

/bash is in /bin and /sh is linked to /bash....

marketsmart 07-12-2006 01:31 AM

is it possible that i need to drop the script in cgi-bin or outside of htdocs?

duckduckgoose 07-12-2006 01:33 AM

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.

marketsmart 07-12-2006 01:45 AM

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... :thumbsup

fuzebox 07-12-2006 01:47 AM

An easy fix would be to change your cron line to this:

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

fuzebox 07-12-2006 01:49 AM

Ah, so the real problem was probably hidden line break characters then... What are you using to edit files?

marketsmart 07-12-2006 01:53 AM

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...

jimthefiend 07-12-2006 03:44 AM

I could help you but I won't.

drjones 07-12-2006 06:13 AM

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


All times are GMT -7. The time now is 03:04 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123