Crontab entry


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Crontab entry
# 1  
Old 06-05-2012
Bug [Solved] Crontab entry

Is this the correct entry to touch a file on 6/6 5AM?

Code:
00 05 06 06 * touch /support/home/.no_copy

Moderator's Comments:
Mod Comment Please use next time code tags for your code and data

Last edited by Me XMan; 06-05-2012 at 11:19 AM.. Reason: Solved
# 2  
Old 06-05-2012
Yes...
This User Gave Thanks to vbe For This Post:
# 3  
Old 06-05-2012
Thanks.
# 4  
Old 06-05-2012
Since you did not specify the OS, please pay attention to a few things about cron:
Code:
 00 05 06 06 * touch /support/home/.no_copy >>tmp/cron_touch.log  2&1

Some OS will send messages (yes error messages...) if the standard output and STD-err are not specified ( redirected to files...)
the same goes if you have in your envirronment things related to interactive shell (e.g TERM set etc...)
be aware also the PATH is VERY limited and no user env. bariable are set...
(That is the first thing that should come to your mind if a job fails when using cron but works when you execute it by command line...)

Last edited by vbe; 06-05-2012 at 11:11 AM.. Reason: typos
# 5  
Old 06-05-2012
It's on AIX 6.1.
# 6  
Old 06-05-2012
To redirect correctly the outputs I think on AIX its not necessary ( I wonder if it doesnt default to /dev/null ) but HP-UX will complain..
The rest stays true... So if you write a job like
Code:
0 3-17 * * * (. ./.profile;sh /home/something_cool)

Add in the .profile a test for interactive shell or not...

And for compatibility I stick to e.g:
Code:
 04 05 * * 1,2,3,4,5 /sm/cron/bin/t_ux >>/sm/cron/log/t_ux.log 2>&1

The reason I do not use 1-5 is for the case I have to skip a day...

Last edited by vbe; 06-05-2012 at 11:29 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

crontab entry

hi i am new in solaris. i am accessing server through putty. i could not add entry in crontab. i have given "crontab -e" for add a new entry. It is not coming. what parameter i have to set for getting crontab -e thanks (1 Reply)
Discussion started by: sunnybee
1 Replies

2. UNIX for Dummies Questions & Answers

Crontab entry

What should be the crontab entry for a script: to run at 3:00 AM EST Sun, Mon, Tue, Wed, Thu, Fri (3 Replies)
Discussion started by: proactiveaditya
3 Replies

3. Solaris

crontab entry

Hi, i need to setup a cronjob that has will execute iostat command from morning to evening time. for instance the timing has will be like this. 8:00 A.M -- 6:00P.M how to define this entry in crontab Regards (3 Replies)
Discussion started by: jaweedak
3 Replies

4. Solaris

crontab entry

How to set the crontab entry for every other Friday? Regards, Raj (1 Reply)
Discussion started by: rajip23
1 Replies

5. AIX

crontab entry

Hi. I'm new to AIX and I need to create a crontab entry to run a script every first 5 business days of the month? please help. (2 Replies)
Discussion started by: udelalv
2 Replies

6. Shell Programming and Scripting

Crontab Entry

Hi Everyone , have a nice day given below is the line i have added in crontab * * * * * /Rauf/script2.sh intended to run this script after every minute , when i run this script manually it runs fine and produces output , but after adding it to crontab ( like given above ) , it doesnt work ... (5 Replies)
Discussion started by: Dastard
5 Replies

7. UNIX for Advanced & Expert Users

crontab entry

Sometimes cron really upsets me and I cant figure out these types of wierd dates, but how do I get cron to run something on every other sunday? I am running Solaris 8. -S (4 Replies)
Discussion started by: Sowser
4 Replies

8. Shell Programming and Scripting

Crontab entry

Hello, I am trying to schedule a job to run every 15 minutes from 7am to 5:30pm. Could someone show me the syntax for this? Thanks. (1 Reply)
Discussion started by: bestbuyernc
1 Replies

9. UNIX for Dummies Questions & Answers

crontab entry

hi all how to schedule a cron job running on last day of every third month at 12 midnight will the following work 0 0 30,31 3,6,9,12 * <required file> thanks (3 Replies)
Discussion started by: matrixmadhan
3 Replies
Login or Register to Ask a Question