Cron JOb Entry


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cron JOb Entry
# 1  
Old 02-26-2013
Cron JOb Entry

Hi All,

i have a folder in a server say xxx.xx.xx.xx\abcd\efgh. i want to make a cron job entry so that i would get a mail (me@example.com) on business days. will this help me...

Code:
30 4 * * 1-5   cd \abcd\efgh|ls-ltr|mailx:me@example.com[IMG]https://www.unix.com/images/editor/code.png


Last edited by Franklin52; 03-19-2013 at 10:58 AM.. Reason: Code tags
# 2  
Old 02-26-2013
Code:
crontab

entry should be like this

Code:
min hour day month day/week   scriptname

You can't write
Code:
cd

like that in the
Code:
cron

Entry.

Creat a script write your program in that and then schedule cronjob like this

Code:
30 4 * * 1-5  yourscript.sh

# 3  
Old 02-26-2013
Thanks much for the instant reply......

i will try that too. but instead of writing that in .sh file running, why i can't i just put those cd thing in last segment of crontab entry...need ur valuble suggestion.Thanks!!
# 4  
Old 02-26-2013
Iam not 100% sure but its not like that it will not work if you do a
Code:
cd

.
Code:
cron

is just use to make a job or a process to run at particular time.

You can do a
Code:
cd

too but its good to use a simple script for the purpose.
# 5  
Old 02-26-2013
Brownie point for creativity - I've never seen nor thought about using code tags like that!
Quote:
You can't write
Code:
cd

like that in the
Code:
cron

Entry.
Why not? cron will execute anything it finds, with the known restrictions applied.
# 6  
Old 02-26-2013
Thanks a lot bro ... that would definetly help me..

---------- Post updated at 06:45 AM ---------- Previous update was at 06:35 AM ----------

Hi Frnds.

i have files created daily in that folder. so it will have hundreds of files.how to get the list of files that are created on that date.i mean for today i should receive a mail with the list of files along with the size created today(2/26/2013)
# 7  
Old 02-26-2013
Hi Mahesh,

What you tried so far, where you stuck?

Regards,
Ravi
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Cron entry

Hi I have a system running solaris 11, in which I am able to execute a script from the command line, but once I put i the crontab does run, but do not give results. The entry is: 15 11 * * * /var/oswbb/./startOSWbb.sh >> myjob.log 2>&1 30 11 * * * /var/oswbb/./stopOSWbb.sh I have check... (2 Replies)
Discussion started by: fretagi
2 Replies

2. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

3. Shell Programming and Scripting

Crontab - entry not working , cron job not running

I have put a cron entry in oracle user for taking hot backup every wednesday@ 2.30 AM and have given the cron entry 30 02 * * 3 /u01/vijay/hotbackupcron 2>&1 >> /u01/vijay/hotbackup.log also find below the script inside hotbackupcron, i have put in env variables as well ... (13 Replies)
Discussion started by: vijaymec50
13 Replies

4. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

5. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

6. Solaris

cron entry

Hi, I have to add two cron entry now. Please correct me if anything wrong Below script should run at every one and half hour. 30 01 * * * /export/home/gxadm/scripts/collect_mq_info.pl $HOME/GCSS/logs > /dev/null 2>&1 Below script should run at every 2 hours 0 02 * * *... (9 Replies)
Discussion started by: Mani_apr08
9 Replies

7. Solaris

User entry in both cron.allow and cron.deny

Hello All, Anybody please help me to know ,what happens when a user having entry in both cron.allow and cron.deny files.Wheather the user will be able to access the crontab??? Thanks in advance Vaisakh (5 Replies)
Discussion started by: ksvaisakh
5 Replies

8. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

9. UNIX for Dummies Questions & Answers

cron entry

Hi, Where can we find Cron job logs?i have a cron job which is not executing at all, 00 12 * * * /xx/yy/job > /pp/qq/log if i execute the job alone,it is executing fine. >/xx/yy/job > /pp/qq/log (is executing fine) but its not executing when it triggered from cron.is there any place cron... (7 Replies)
Discussion started by: rujus
7 Replies

10. Shell Programming and Scripting

Cron job entry not running

Hi, I am facing this problem . My Cronjob entry is not running !!! I am having Sun solaris 9 and cronjob entry is "45 1 * * * /safedir/rdns/opt/RDNS1.1Scripts/drpl_audit_log_script.sh_orig > /dev/null 2>&1" Now when I try to look in the output log files it creates, it is some file with... (1 Reply)
Discussion started by: hkapil
1 Replies
Login or Register to Ask a Question