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?
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.
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.