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...

30 4 * * 1-5   cd \abcd\efgh|ls-ltr|mailx:me@example.comhttp://linux.unix.com/images/editor/code.png
crontab

entry should be like this

min hour day month day/week   scriptname

You can't write

cd

like that in the

cron

Entry.

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

30 4 * * 1-5  yourscript.sh

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!!

Iam not 100% sure but its not like that it will not work if you do a

cd

.

cron

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

You can do a

cd

too but its good to use a simple script for the purpose.

Brownie point for creativity - I've never seen nor thought about using code tags like that!

Why not? cron will execute anything it finds, with the known restrictions applied.

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)

Hi Mahesh,

What you tried so far, where you stuck?

Regards,
Ravi

Did you consider an advanced search in these forums? That topic has been covered a zillion times!

Try

find

command and search it on this forum. You will get the answer.:slight_smile:

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 .
[root@localhost maths]# crontab -e
crontab: installing new crontab

Can you please check where it went wrong..

---------- Post updated at 07:49 AM ---------- Previous update was at 07:42 AM ----------

In the above script , i just routing output to tmp file.

crontab is not running at all

You are not suppose to hijack some ones else post!!..

Please post a fresh one with your question and use code tags when placing your data.