Schedule a cron job


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Schedule a cron job
# 1  
Old 09-12-2011
Schedule a cron job

Hi,

Can anyone help me out with scheduling a cron job for the below:

i wnated to delete file from a folder on every sunday at 05:00 AM

this is code i have used.
*******************************************************
Code:
0 05 * * 0 find /abc/xyz/pqrs/bak/  -type f -mtime +30 -exec rm -f {} \;

*******************************************************

How this was not executed as planned....

can you please let me know if i have missed anything.

Thanks in advance.

Last edited by pludi; 09-12-2011 at 05:34 PM..
# 2  
Old 09-12-2011
Try putting that command to a script file and call that script instead.
# 3  
Old 09-13-2011
What does your syslog or cron log says? Can you please paste that ?
# 4  
Old 09-13-2011
i am new to cron jobs....
Can you plz let me know how do check the syslogs or corn logs?
# 5  
Old 09-14-2011
the cron entry is
Code:
0 05 * * S find /abc/xyz/pqrs/bak/  -type f -mtime +30 -exec rm -f {} \;

what is the content of the directory /abc/xyz/pqrs/bak ?

Last edited by Franklin52; 09-14-2011 at 04:11 AM.. Reason: Please use code tags for code and data samples, thank you
# 6  
Old 09-14-2011
syslog is file, /var/log/syslog

go to that particular time inside that file, and look for any errors !
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Cron job is not running on schedule

Scheduled job is not running on time.but it is running when executing same command manually. 25 10 * * * /code/bin/ACCOUNT.ksh 1 >/dev/null 2 >&1 Manually executing the same Ksh -x /code/bin/ACCOUNT.ksh 1 >/dev/null 2 >&1 Followed steps Crontab -e Added the job to cron tab. (4 Replies)
Discussion started by: Myguest
4 Replies

2. UNIX for Beginners Questions & Answers

Schedule the cron job for every 21day on saturday

Please guide me how to schedule the cron job to run on every Saturday at 6am with the interval of 21 days. (2 Replies)
Discussion started by: raghavendrajsv
2 Replies

3. Shell Programming and Scripting

schedule a job without Cron

Hi All, Is there any way (any utility) to schedule a job to run once in a week on RedHat Linux ? Note- Do not using Crontab. Thanks Pravin (1 Reply)
Discussion started by: pravin27
1 Replies

4. Shell Programming and Scripting

Schedule a Cron job

Hi all, I am new to cron jobs.. i wanted to schedule a cron job that wil send a mail to me at 3:00PM on 10th August ie is on Wednesday. 0 15 10 8 3 echo "message from UNIX here"|mail -s "your subject here" user@user.com However this was not executed... Can anyone please... (0 Replies)
Discussion started by: ch33ry
0 Replies

5. Shell Programming and Scripting

Cron to schedule job at different times

Hi, I want to run cron scheduler to run some script at different times of the day.But these times don't have some fix intervals. So how we can run jobs at 6:30AM, 1:00PM and 4:30PM everyday. Please help. Thanks Neeraj (2 Replies)
Discussion started by: apjneeraj
2 Replies

6. Shell Programming and Scripting

unable to schedule job in cron

Hi, from normal user(oracle) i am unable to run scheduled job in cron: os version: bash-2.03$ uname -a SunOS sumail02 5.8 Generic_117350-39 sun4u sparc SUNW,Ultra-60 bash-2.03$ crontab -l 55 * * * * sh /oracle/statistics.sh > /dev/null 2>&1 bash-2.03$ cat /oracle/statistics.sh... (2 Replies)
Discussion started by: prakash.gr
2 Replies

7. 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
Login or Register to Ask a Question