Very urgent!! Cron problems


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Very urgent!! Cron problems
# 1  
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!
# 2  
Please post your root crontab file and we will take a look for you.
# 3  
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]
# 4  
CPU & Memory find your executable file "tar"

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.
# 5  
Message from pappous:
Quote:
I tried what you told me to do and I didn't get the date on my screen.

I edited the log file and there were entries like this:

> CMD: echo Date is 'date' > /dev/console
> root 3802 c Mon Feb 19 22:49:00 2001

< root 3802 c Mon Feb 19 22:49:00 2001

The same thing is happening with my old cronfile. Also I noticed that the system date is wrong. It appears to be 22:49 though on scoadmin-system time it is 14:54 (which is the correct)

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]
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #15
Difficulty: Easy
UDP is a connection-oriented protocol.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Problems with set up Cron

Hi I want to set up a cron for every 15 minutes between some hours. Can you tell whether the below command will work. Getting confuse because my time goes from night to next day morning. i want to setup 8 PM to next day 10 AM. */15 20-10 * * * sh abc.sh (1 Reply)
Discussion started by: raju2016
1 Replies

2. Shell Programming and Scripting

Execution problems with cron

I am new to creating crontab file , i just wrote below (40 19 * 3 * /root/maths/practisecron.sh), the script just prints "Hi". When ever i save the above file i am getting this . # crontab -e crontab: installing new crontab Can you please check where it went wrong.. (1 Reply)
Discussion started by: vkiyv05
1 Replies

3. UNIX for Dummies Questions & Answers

cron problems

I am trying to setup a cron that runs a script to update my ip for my domain name every time I reboot and checks if my ip changes every 5 minutes and if it does then I update it. I am running Ubuntu server 12.04. The file /etc/cron.d/ipupdate contains # # # Run ipupdate # # /5 * ... (3 Replies)
Discussion started by: Bros2
3 Replies

4. UNIX for Dummies Questions & Answers

Problems using rsync with cron

Hi, I've created a cron job for a script with a rsync command in it. The script is named pull.sh and contains the following line : What it is supposed to do is pull backup files from the production server of my company to my local server. It should also generate the log file (output.log)... (1 Reply)
Discussion started by: anaigini45
1 Replies

5. UNIX for Dummies Questions & Answers

cron job problem(urgent)

Hey all. Im totally new with makeing websites ect The thing is, i wanted to make one of those pimp games, so i installed a script called mypimpscript.. it works but the 10mins cron jobs dont... ive tried to set it up in cpanel, but im doing it wrong :S right now it looks like this php... (1 Reply)
Discussion started by: princess
1 Replies

6. UNIX for Dummies Questions & Answers

Problems in generating the mail from cron -- very urgent help me

Hi, I wrote a script which generates a mail automatically under certain condition. When i execute the script manually in unix the script is getting executed and the condition works accordingly and the mail is also generated. But when it is pu into cron the mail is not generated and the... (4 Replies)
Discussion started by: thiru_cs
4 Replies

7. Shell Programming and Scripting

Facing problems when FTPING file from server to local (Very Urgent)

Hi, when i am trying to FTP one file (test.txt) from Unix server to my local machine then i am getting the following error, as shown below ftp> binary 200 Type set to I. ftp> put C:\FTP\test.txt C:FTPtest.txt: No such file or directory ftp> The red color text is the error. Can... (3 Replies)
Discussion started by: sunitachoudhury
3 Replies

8. Shell Programming and Scripting

How to Schedule job using cron(URGENT)

Hello All, I m newbie to Job scheduling. Suppose i have 2 files s1.sh and s2.sh i want to make a schedule such as run s1.sh at 2AM everyday and run s2.sh 9Pm everyday. Can anyone tell me how to schdule that using CRON and i want to know what is CRON and CRONTAB. Thanks in advance (2 Replies)
Discussion started by: ravi.sadani19
2 Replies

9. UNIX for Dummies Questions & Answers

cron problems

Hi there, this time a have a other problem :) i will start a script over the cron. if i start the script manual (per command) it works without any problems, but over the cron it doesent work. my cron looks like this: 26 15 * * * /path/scriptname.sh 2> /path/error.log there is no... (3 Replies)
Discussion started by: scotty
3 Replies

10. UNIX for Advanced & Expert Users

Cron problems

Hi, I am having a few problems with cron. I have created a shell script (to rotate www logs - this works) and then did the following (as root) #crontab -e 2 0 * * 3 /cron_scripts/wwwlogs.sh ? w ? q # crontab -l entry not shown e.g. it did not show what I had just writern I then... (6 Replies)
Discussion started by: warrend
6 Replies

Featured Tech Videos