but before we use cron to test the email, we just simply want to copy the file from one particular file e.g. file.txt to backup.txt,
but it also not function. maybe I now attach the file, so can u please help me to take a look, to see whether it has problem??

here are the steps we have done:
1. create a txt file called "file.txt"
2. create a crontab file called "mycronfile" and the command line inside the file is "7 18 25 4 4 cp ../usr/test/file.txt ../usr/test/backup.txt
3. put "mycronfile" to the folder ./etc/cron.d
4. In Konsole typed "crontab mycronfile"
5. But no backup.txt is created

really thanks a lot.
Who is Participating?
ahoffmannConnect With a Mentor Commented:
did you wait 'til 18:07 ?
sandysansanAuthor Commented:
yup, I wait until 18:07, is there any problem??
if cron did not produce what you want at 18:07, then check roots mail, cron mails errors to root
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

sandysansanAuthor Commented:
I have also checked mail for root, but "No mail for root"  displayed only.
Is there any special setting needed before I can checked email?
bryanhConnect With a Mentor Commented:
First of all, there are various cron facilities, and the one I use is probably not the one you use, so my advice could be a little off.

Cron traditionally mails all output (error messages and otherwise) to the user for whom the event was run.  Which may or may not be root.  If it isn't configured properly, it may be unable to do this mailing, though.  Another source of information about cron is syslog.  Syslog messages often go the file /var/log/messages or other files in /var/log.

As a check on what you're doing, you should run 'crontab -l'.  If you successfully installed that cron file, crontab -l should list it back to you.

And to eliminate some variables and facilitate your testing, you should make that entry * * * * * instead of 7 18 25 4 4.  That means "run once every minute."

Do you have any evidence the cron daemon is running at all?
Just some notes:
- no nees to put manually the file in /etc/cron.d/. Just do
"crontab filename" or "crontab -e" and type the line there.
- specifying ALL the 5 time parameters doesn't make much sense.  Generally only some are specified, the rest being replaced by "*".

And now the fatal error: you used relative paths. DON'T ! use full paths, or use scripts that chdir to the desired directory before using relative paths.

Radu-Adrian Feurdean
Brainbench Linux MVP
sandysansanAuthor Commented:
I have typed crontab -l
and the ouput is:

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.1276 installed on Fri May  3 02:29:53 2002)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
* * * * * root/test/


echo "`date`"
echo "--Testing cron -> mail"

I have also typed "crontab -e" and type
* * * * * root/test/

After exit to [root@XXXXX]#
I typed "mail" but display "No mail to root"

What is the problem?
anything I am wrong......Thanks a lot for your kindly help
silly question: did you miss a leading slash in
You could eliminate a few variables from this test by using /bin/touch /tmp/cronisalive in place of root/test/
That way, you're not depending on mail working, for one thing.
(but make sure you have a /bin/touch -- I'm not sure where it conventionally lives).

I still wonder if you have any evidence crond is running.  Do you see it in a ps -ax listing?  Do you see any messages from it in any log files?

Have you tried killing and restarting crond?
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: ahoffmann {http:#6968794} & bryanh {http:#6987735}

Please leave any comments here within the next seven days.

EE Cleanup Volunteer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.