Very urgent!! Cron problems

I'm having serious problems running cron. I want to create midnight backups of my files on my unix server and there is something wrong with cron.

Here is what I do:

First I saw that cron is running (while logged on as root) by typing "ps -aedf|grep cron" and I noticed that there is 1 instance of cron running (/etc/cron).

Then with "crontab -e", I created another entry on the root file: "0 3 * * * tar cvbf 20 /dev/rst0 /u/csa". At first I had "0 3 * * * /etc/default/tar cvbf.....", but I noticed that by typing /etc/default/tar... at prompt I get "cannot execute" error message.

Anyway, I restarted the server (I'm not supposed to log on as root again) but no backups are taked at 3am, 2 weeks now... I've tried many things but still nothing! Any ideas?

Thanks!

Please post your root crontab file and we will take a look for you.

Didn't you get any warning mail from crontab?

Crontab is designed so that if there are any problems running your program at the specified time, it will send a warning mail to your account.

try the following

First save the current crontab using the command:
crontab -l > cronfile.backup

then edit a new crontab file using vi(or your favourite) which contains only these lines.

# cron testing

          • echo Date is `date` > /dev/console

then load it using..
crontab cronfile

Now cron should run every minute the date command and display it to the console.

This will at least test to see if cron is working.

You may also want to check cron.allow and cron.deny files
man crontab for more details.

and also check /var/log/cron

for your current purpose you can use 'at' command. Although it is not a substitute to cron it will help you untill you resolves your crontab problem.

note: To restore your actual cronfile after testing first remove current cronfile using crontab -r then crontab cronfile.backup

[Edited by mib on 02-19-2001 at 02:47 AM]

Hi, try this command to search all tar files on your Machine.
Login as root user and execute:
find / -name "tar" -print 2>/dev/null
then for each file founded do the next:
ls -l /home/ftp/bin/tar, and you may see something like this:
lrwxrwxrwx 1 root sys 13 Aug 30 14:21 /home/ftp/bin/tar -> /usr/sbin/tar
the next step is file /usr/sbin/tar (see what happened when you run the same command to linker file) and your answer is:
$ file /usr/sbin/tar
$ /usr/sbin/tar: ELF 32-bit LSB executable 80386 Version 1
$ file /home/ftp/bin/tar
$ /home/ftp/bin/tar: ELF 32-bit LSB executable 80386 Version 1

But yor /etc/default/tar file is an ASCII file, not an executable one. That why your error.

I hope help you.
See you.

Message from pappous:

Include the "MAILTO=root" at the beginning of your cronfile. this will assure you'll get an email sent to you which may very well define your problem. You can also include "PATH=PATH" "SHELL=YOUR SHELL".

try echo "Testing cronfile" >> /any path/cron.test instead of /dev/console. And check that file(cron.test).

Regarding wrong date in Cron I cann't help you. That's why I posted it here.

[Edited by mib on 02-20-2001 at 09:50 AM]