Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Having Problem Running A Cronjob, it seems to be executed but aint working
Robert83
post Nov 15 2004, 06:20 PM
Post #1


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hello

I'm trying to run the following script which runs ok if I execute it via /home/sarg/sarg
CODE
#!/bin/bash

# Get current day

TODAY=$(date +%d/%m/%Y)

# Get one week ago today

LASTWEEK=$(date --date "7 days ago" +%d/%m/%Y)

/usr/bin/sarg -d $LASTWEEK-$TODAY

exit 0


the crontab -l (looks like this)
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0 3,9,15,21 * * * /usr/bin/rdate -s time.nist.gov
27 0 * * 2 root /home/sarg/sarg


the /var/log/cron shows that the cronjob ran at the time it was specified but nothing happened (if I run the script manualy it works), what did I mess up here?

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Robert83
post Nov 16 2004, 04:28 AM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

modified my cronjob to this

0 3,9,15,21 * * * /usr/bin/rdate -s time.nist.gov
15 23 * * 1 /home/sarg/sarg

and it works now smile.gif (why was that root a problem???) (I tried removing that path above before but did not solve the problem...why was root in the way?) (/home/sarg/sarg is accessible by root)

can someone explain why is it working now smile.gif ?

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th October 2017 - 06:37 PM