Crontab Problem for maintenance


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Crontab Problem for maintenance
# 1  
Old 07-16-2009
Crontab Problem for maintenance

hi All i have problem for crontab command for maintenance mail server.
we call crontab file is maintenance.sh on root directory
/maintenance.sh

is case we maintenance to delete .log dan .txt
in mail server, instruction is

1. /var/spool/qmailscan/
2.rm -f *.log
3.cd quarantine/new/
4.rm -f *
5.reboot

Step i use :
1. vi /maintenance.sh

#!/bin/bash
cd /var/spool/qmailscan/
rm -f *.log
cd quarantine/new/
rm -f *
reboot

2. i edit crontab with crontab -e

0 0 * * * root /maintenance.sh

i want execute crontab everyday at time 24.00

Thanks for all solution and how to write crontab language.


Reggard

Moslemovic
# 2  
Old 07-16-2009
The good link to learn about the crontab :

Code:
http://www.adminschoice.com/docs/crontab.htm

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

problem with crontab

hi all does any on has explanation for this result bash-3.00$ crontab -e "/var/tmp/Ex1kayUW" No space left on device The crontab file was not changed. bash-3.00$ (2 Replies)
Discussion started by: osmannix
2 Replies

2. Solaris

Crontab Problem

Dear All I have machine with SunOS APP5a 5.9 Generic_122300-19 sun4u sparc SUNW,Sun-Fire With crontab like this : 59 23 * * * /home/lng/script/move_and_compress_logs_update.sh But that crontab cannot running at that time. I run my script by manually, the result is fine. What must I check at... (5 Replies)
Discussion started by: mbah_jiman
5 Replies

3. Shell Programming and Scripting

Problem with crontab

Hi, I have one script which takes data from table and spools it into a file. When i am running manually all is fine but while trying same script thru crontab the spooled file is not getting generated..... :confused: The mail part is working fine....only prob is the spooled file. Please... (15 Replies)
Discussion started by: fidelis
15 Replies

4. UNIX for Dummies Questions & Answers

Crontab problem!

Hi All, i added a sh script to crontab, it run but there is sqlplus expression that generate a spool file(gun.lst). this expression didnt run. Summary, 1- my main script is topl.sh that i added it to Cron via "crontab -e" command 2- There is "sqlplus username/password@serverA @umt.sql"... (6 Replies)
Discussion started by: temhem
6 Replies

5. AIX

Problem with crontab

Hi, Can anyone let me know the functionality of the following command in Unix crontab ;l Thanks, Wajith.M (3 Replies)
Discussion started by: Wajith
3 Replies

6. Solaris

Crontab problem

Hi all, Why my crontab -e from root user is not accessible? It came out some sort of random number, 309. And also for other user, crontab -l came out crontab: can't open your crontab file. I'm grateful for any any help. thanks. (9 Replies)
Discussion started by: beginningDBA
9 Replies

7. UNIX for Dummies Questions & Answers

problem with crontab

i added to my crontab file: * * * * * echo "hello" it works, i receive a message into my /var/mail/username and i receive: bob in addition to a large text add-on any help appreciated (1 Reply)
Discussion started by: cleansing_flame
1 Replies

8. Shell Programming and Scripting

Crontab problem

now, i have a program that runs a task for users. now, when users run this program, the program will get to a point where it will need certain entries in the crontab to be commented out. when it gets to that point, the program will ask the user to perform the crontab task task and when the user... (1 Reply)
Discussion started by: Terrible
1 Replies

9. UNIX for Dummies Questions & Answers

Problem with Crontab

I have a problem with crontab. I made a class file name Mailer.class. When I run it at command line like this: $ java Mailer It runs very well and I got the email. But If I put it in a crontab line like this: 30 11 * * * java Mailer It doesn't work. Every time the cron job... (5 Replies)
Discussion started by: qhuynh
5 Replies

10. UNIX for Dummies Questions & Answers

crontab problem

Hi, I trying to include a script in my crontab as user. I used "crontab -e" to include my script there but does not seem to work. If I understand correctly it is set to run at 11:20 every day, correct? Can anybody identify any error? <pre> #Sun Microsystems Inc. SunOS 5.7 Generic... (19 Replies)
Discussion started by: guest100
19 Replies
Login or Register to Ask a Question