Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Crontab not working or smth :(
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
G3n2
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2004
Posts: 127

PostPosted: Fri Aug 27, 2004 2:19 am    Post subject: Crontab not working or smth :( Reply with quote

hey and such :D
im trying out the 'power' of crontab , but it aint doing sh*t :(
i configured it to echo some messages at some hours this night , but i have not seen any echo's , so whats the matter ?
can anyone help me , tell me what im doing wrong?
thx.

my crontab:
Code:

# /etc/crontab
# 20 Apr 2002; Thilo Bangert <bangert@gentoo.org>
# $Header: /var/cvsroot/gentoo-x86/sys-apps/dcron/files/crontab-2.9-r1,v 1.4 2004/07/18 04:33:20 dragonheart Exp $

# fcron || dcron:
# This is NOT the system crontab! fcron and dcron do not support a system crontab.
# to get /etc/cron.{hourly|daily|weekly|montly} working with fcron or dcron do
# crontab /etc/crontab
# as root.
# NOTE: This will REPLACE root's current crontab!!


# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly

0  *  * * *      rm -f /var/spool/cron/lastrun/cron.hourly
1  3  * * *      rm -f /var/spool/cron/lastrun/cron.daily
15 4  * * 6      rm -f /var/spool/cron/lastrun/cron.weekly
30 5  1 * *      rm -f /var/spool/cron/lastrun/cron.monthly
*/10  *  * * *      test -x /usr/sbin/run-crons && /usr/sbin/run-crons

00 2 * * * echo testing crontab
00 3 * * * echo testing crontab
00 4 * * * echo testing crontab
00 5 * * * echo testing crontab
00 6 * * * echo testing crontab
00 7 * * * echo testing crontab
00 8 * * * echo testing crontab
00 9 * * * echo testing crontab


and yes , crontab is running , and i have done crontab /etc/crontab :)

thx for any help u can give me.

-G3n2
Back to top
View user's profile Send private message
JackBak
n00b
n00b


Joined: 14 Aug 2004
Posts: 49
Location: Boulder, Colorado

PostPosted: Fri Aug 27, 2004 2:37 am    Post subject: Reply with quote

Where are you expecting it to echo to? Take a look in the syslog stuff.

Try /var/log/crond/current
Back to top
View user's profile Send private message
G3n2
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2004
Posts: 127

PostPosted: Fri Aug 27, 2004 2:49 am    Post subject: Reply with quote

i want it to echo to /bin/bash , console , whatever u might call it :) , to all root user's on the system
there is no /var/log/crond

-help 8O
thanks

-G3n2
Back to top
View user's profile Send private message
JackBak
n00b
n00b


Joined: 14 Aug 2004
Posts: 49
Location: Boulder, Colorado

PostPosted: Fri Aug 27, 2004 3:10 am    Post subject: Reply with quote

Do a
Code:
man fcron
and see if what you want is the -f option
Back to top
View user's profile Send private message
G3n2
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2004
Posts: 127

PostPosted: Fri Aug 27, 2004 3:53 pm    Post subject: Reply with quote

i tried this :

Code:

crontab -e
editing root's crontab


this gives me :
Code:

# /etc/crontab
#
# $Header: /var/cvsroot/gentoo-x86/sys-apps/fcron/files/crontab,v 1.7 2004/07/18 04:34:03 dragonheart Exp $

# fcron || dcron:
# This is NOT the system crontab! fcron and dcron do not support a system crontab.
# to get /etc/cron.{hourly|daily|weekly|montly} working with fcron or dcron do
# crontab /etc/crontab
# as root.
# NOTE: This will REPLACE root's current crontab!!
# 20 Apr 2002; Thilo Bangert <bangert@gentoo.org>

# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly

0  *  * * *      rm -f /var/spool/cron/lastrun/cron.hourly
1  3  * * *      rm -f /var/spool/cron/lastrun/cron.daily
15 4  * * 6      rm -f /var/spool/cron/lastrun/cron.weekly
30 5  1 * *      rm -f /var/spool/cron/lastrun/cron.monthly
*/10  *  * * *      /usr/bin/test -x /usr/sbin/run-crons && /usr/sbin/run-crons


i added :
Code:

*/1 * * * * echo 'testing crontab'
*/1 * * * * echo testing crontab
*/1 * * * * echo -f testing crontab
*/1 * * * * echo -f 'testing crontab'


so it would try to echo in different ways ever 1 minute, but still im not getting any echo's in console window :|

any suggestions ?
thx

Edit
trying this too:
Code:

*/9 * * * * cp -f /var/www/localhost/htdocs/test.delete /var/www/localhost/htdocs/crontab/test.delete
*/10 * * * * rm -f /var/www/localhost/htdocs/crontab/test.delete

/Edit


-G3n2
Back to top
View user's profile Send private message
G3n2
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2004
Posts: 127

PostPosted: Fri Aug 27, 2004 4:13 pm    Post subject: Reply with quote

nope crontab does nothing except checking those lame .weekly .monthly dirs , which i DONT want :(

any help is much appreciated !

-G3n2
Back to top
View user's profile Send private message
G3n2
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2004
Posts: 127

PostPosted: Sat Aug 28, 2004 3:13 pm    Post subject: Reply with quote

blegh , it works as of now , nothing changed , oh well :roll:
Back to top
View user's profile Send private message
Guybrush
Tux's lil' helper
Tux's lil' helper


Joined: 06 Feb 2003
Posts: 99
Location: 48°27'N, 11°8'O

PostPosted: Wed Oct 27, 2004 2:04 pm    Post subject: Reply with quote

Hi G3n2,

I had the same problem that things added into /etc/crontab didn't work.
After googling around, I found that neither dcron nor fcron support a
system-wide /etc/crontab. These deamons don't bother about the things you
insert into this file until you "copy" it to root's crontab with
Code:
crontab /etc/crontab

Therefore, you have to "copy" /etc/crontab over to root's crontab every time you edit this file accordingly. But be careful that you don't overwrite changes you made in root's crontab via
Code:
crontab -e

The only daemon in the portage tree supporting a system-wide /etc/crontab is vixie-cron AFAIK. So I recently switched from dcron to vixie-cron and everything works fine since then.

Hope this helps you a little bit. :lol:
Back to top
View user's profile Send private message
anshul
n00b
n00b


Joined: 15 Oct 2004
Posts: 64
Location: Mumbai, India

PostPosted: Fri Oct 29, 2004 9:13 pm    Post subject: Reply with quote

Guybrush wrote:
Hi G3n2,

I had the same problem that things added into /etc/crontab didn't work.
After googling around, I found that neither dcron nor fcron support a
system-wide /etc/crontab. These deamons don't bother about the things you
insert into this file until you "copy" it to root's crontab with
Code:
crontab /etc/crontab

Therefore, you have to "copy" /etc/crontab over to root's crontab every time you edit this file accordingly. But be careful that you don't overwrite changes you made in root's crontab via
Code:
crontab -e

The only daemon in the portage tree supporting a system-wide /etc/crontab is vixie-cron AFAIK. So I recently switched from dcron to vixie-cron and everything works fine since then.

Hope this helps you a little bit. :lol:


i am using vixie cron and i tried to make my(root) crontab using
Code:
# crontab -u anshul l -e

but it never worked
i tried
Code:
31 2 * * * xmms /songs/abd.mp3

but it never opened xmms at 2:31 am. can anyone tell me what is the problem? also i am not being able to make a crontab as an ordinary user.

regards
anshul
Back to top
View user's profile Send private message
anshul
n00b
n00b


Joined: 15 Oct 2004
Posts: 64
Location: Mumbai, India

PostPosted: Fri Oct 29, 2004 9:15 pm    Post subject: Reply with quote

i am using vixie cron and i tried to make my(root) crontab using
Code:
# crontab -u anshul  -e

no error occured and it said that the crontab is installed but it never worked
i wrote in my crontab file as:
Code:
31 2 * * * xmms /songs/abd.mp3

but it never opened xmms at 2:31 am. can anyone tell me what is the problem? also i am not being able to make a crontab as an ordinary user.

regards
anshul[/quote]
Back to top
View user's profile Send private message
anshul
n00b
n00b


Joined: 15 Oct 2004
Posts: 64
Location: Mumbai, India

PostPosted: Fri Oct 29, 2004 9:15 pm    Post subject: Reply with quote

i am using vixie cron and i tried to make my(root) crontab using
Code:
# crontab -u anshul  -e

no error occured and it said that the crontab is installed but it never worked
i wrote in my crontab file as:
Code:
31 2 * * * xmms /songs/abd.mp3

but it never opened xmms at 2:31 am. can anyone tell me what is the problem? also i am not being able to make a crontab as an ordinary user.

regards
anshul[/quote]
Back to top
View user's profile Send private message
dentament
n00b
n00b


Joined: 16 Jun 2004
Posts: 74

PostPosted: Tue Nov 02, 2004 8:55 pm    Post subject: Reply with quote

anshul:

xmms works only with X.

So you could do it this way:

Code:
31 2 * * * export DISPLAY=:0 && xmms /songs/abd.mp3


...but you must be sure that X is running at 2:31 :) and that it got started by the same user whose crontab you've edited (root, you told ... btw: don't use root accounts to do day-by-day working).

Otherwise it will not work.

So I really think you'd better use a command line player like madplay or something... for example by adding to your 'normal user' crontab ('crontab -u <normaluser> -e')...

Code:
31 2 * * * madplay /songs/abd.mp3


Bye
Back to top
View user's profile Send private message
dentament
n00b
n00b


Joined: 16 Jun 2004
Posts: 74

PostPosted: Tue Nov 02, 2004 9:38 pm    Post subject: Reply with quote

anshul:

Quote:
also i am not being able to make a crontab as an ordinary user.


..read 'Why can't my user use their own crontab?' on http://www.gentoo.org/doc/en/faq.xml
Back to top
View user's profile Send private message
anshul
n00b
n00b


Joined: 15 Oct 2004
Posts: 64
Location: Mumbai, India

PostPosted: Wed Nov 03, 2004 3:45 am    Post subject: Reply with quote

dentament wrote:
anshul:

Quote:
also i am not being able to make a crontab as an ordinary user.


..read 'Why can't my user use their own crontab?' on http://www.gentoo.org/doc/en/faq.xml


i did changes in /etc/goup file to make ordinary user in the the grp of cron

Quote:
cron::16:cron,anshul


also then i change the permissions of /usr/bin/crontab to 755 so that group user can access it.
now on running

Quote:
crontab -u anshul -e
it gives the following error
Quote:
must be privileged to use -u


what can i do now?

regards
anshul
Back to top
View user's profile Send private message
anshul
n00b
n00b


Joined: 15 Oct 2004
Posts: 64
Location: Mumbai, India

PostPosted: Wed Nov 03, 2004 1:31 pm    Post subject: Reply with quote

dentament wrote:
anshul:

xmms works only with X.

So you could do it this way:

Code:
31 2 * * * export DISPLAY=:0 && xmms /songs/abd.mp3


...but you must be sure that X is running at 2:31 :) and that it got started by the same user whose crontab you've edited (root, you told ... btw: don't use root accounts to do day-by-day working).

Otherwise it will not work.

So I really think you'd better use a command line player like madplay or something... for example by adding to your 'normal user' crontab ('crontab -u <normaluser> -e')...

Code:
31 2 * * * madplay /songs/abd.mp3


Bye


madplay thing works with cron but how to make even xmms and other utilities work with cron... even when my xserver is running these things do not work with cron. eg
xmms, gaim.....also pine and shell commands like
Code:
who am i
are not working....can any onetell what sort of work cron can do for u.i mean what all commands can be executed by cron.
also i am not being to make crontab via normal user. i have to make crontab of normal user via root account....
can anyone plz guide me.
thanks in advance.

regards
anshul
Back to top
View user's profile Send private message
Guybrush
Tux's lil' helper
Tux's lil' helper


Joined: 06 Feb 2003
Posts: 99
Location: 48°27'N, 11°8'O

PostPosted: Wed Nov 17, 2004 11:31 am    Post subject: Reply with quote

Hi G3n2,

cron is not intended to "echo" something to any console, every output a cron job creates is sent via mail to

- the user who owns the cron job (variable MAILTO not set in the crontab file)
- the mail account defined in the variable MAILTO
- or no output at all if MAILTO = "" (empty value)

according to
Code:
man 5 crontab

You shold first find out where mails to root will be delivered to (AFAIK if you haven't configured anything for sending mail, they will be stored in
Code:
/root/dead.letter

If you have mail delivery configured, output by crontab should be in root's mailbox.

Bye
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum