LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-18-2005, 06:35 PM   #1
Galphar
LQ Newbie
 
Registered: Aug 2003
Location: Independence, KY
Distribution: Redhat 9
Posts: 8

Rep: Reputation: 0
Cron script troubles


What I am trying to do is use a script to upload a gameserver log to a webserver and then have it run the parser over the internet. The script I have works for doing this, but when I set up a cron job to run the script every 12 hrs it doesn't upload the log for me.

Here is the script:

#/bin/sh
ftp -n -v www.bls4sof.com </home/galphar/.sof2/rocmod/ftpcmds.txt> /home/galphar/.sof2/rocmod/ftpupdate.log
wget http://www.bls4sof.com/Stats/fragland/UltraStats/bin/update.php
wget http://www.bls4sof.com/Stats/fragland/UltraStats/bin/update.php
wget http://www.bls4sof.com/Stats/fragland/UltraStats/bin/update.php
wget http://www.bls4sof.com/Stats/fragland/UltraStats/bin/update.php
wget http://www.bls4sof.com/Stats/fragland/UltraStats/bin/update.php


I tried adding the line cd /home/galphar/.sof2/rocmod to beginning of the script but then i get this output:

[galphar@BLS4SOF rocmod]$ ./update1.sh
: No such file or directoryhome/galphar/.sof2/rocmod
--16:20:42-- http://www.bls4sof.com/Stats/fragland/UltraStats/bin/update.php%0D
=> `update.php%0D'
Resolving www.bls4sof.com... done.
Connecting to www.bls4sof.com[12.10.101.24]:80... connected.
HTTP request sent, awaiting response... 400 Bad Request
16:20:42 ERROR 400: Bad Request.

--16:20:42-- http://www.bls4sof.com/Stats/fragland/UltraStats/bin/update.php%0D
=> `update.php%0D'
Resolving www.bls4sof.com... done.
Connecting to www.bls4sof.com[12.10.101.24]:80... connected.
HTTP request sent, awaiting response... 400 Bad Request
16:20:42 ERROR 400: Bad Request.

--16:20:42-- http://www.bls4sof.com/Stats/fragland/UltraStats/bin/update.php%0D
=> `update.php%0D'
Resolving www.bls4sof.com... done.
Connecting to www.bls4sof.com[12.10.101.24]:80... connected.
HTTP request sent, awaiting response... 400 Bad Request
16:20:42 ERROR 400: Bad Request.

--16:20:42-- http://www.bls4sof.com/Stats/fragland/UltraStats/bin/update.php%0D
=> `update.php%0D'
Resolving www.bls4sof.com... done.
Connecting to www.bls4sof.com[12.10.101.24]:80... connected.
HTTP request sent, awaiting response... 400 Bad Request
16:20:42 ERROR 400: Bad Request.

--16:20:42-- http://www.bls4sof.com/Stats/fragland/UltraStats/bin/update.php%0D
=> `update.php%0D'
Resolving www.bls4sof.com... done.
Connecting to www.bls4sof.com[12.10.101.24]:80... connected.
HTTP request sent, awaiting response... 400 Bad Request
16:20:42 ERROR 400: Bad Request.

Any help on this would be highly appreiciated.

Last edited by Galphar; 01-18-2005 at 06:38 PM.
 
Old 01-19-2005, 02:32 PM   #2
student04
Member
 
Registered: Jan 2004
Location: Georgia
Distribution: OS X, CentOS
Posts: 669

Rep: Reputation: 34
If the script works fine, then your syntax for the cron job would be incorrect.. how did you add it, and what did you type? crontab -e will bring up the crontab file associated with the username that invoked it. Here is the syntax (copied from my crontab file)
Code:
# Minute  Hour  Day  Month  DayOfWeek  Command
# sample:
05 13  *  *  Mon  /usr/bin/updatedb
This would run /usr/bin/updatedb at 1:05 PM every monday of the year. So to have your script run every 12 hours the syntax might look something like this:
Code:
00   00   *   *   *   cd /path/to/folder/ && sh yourScript.sh
00   12   *   *   *   cd /path/to/folder/ && sh yourScript.sh

Last edited by student04; 01-19-2005 at 02:35 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 09:09 AM
cron bash script troubles zzyzx Slackware 3 04-12-2005 01:27 PM
Cron troubles caps_phisto Linux - General 7 03-06-2005 11:50 PM
PPPD Script problem when cron-scheduling the script andresurzagasti Linux - Networking 0 11-24-2004 03:54 PM
Help with Script and Cron goldstonrumpke Linux - Newbie 10 05-31-2004 12:51 AM


All times are GMT -5. The time now is 06:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration