LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cron (https://www.linuxquestions.org/questions/linux-newbie-8/cron-824152/)

rhklinux 08-04-2010 11:14 AM

cron
 
Hi,:newbie:

i am learning cron !!
(local use of cron only , not using ftp and that stuff)
the code given is written for learning cron , there is no specific purpose i want to do !!
i use ubuntu 10.04
i have two questions !!
1)
for my 1st hand on cron i had done following :

my file -> crontab.txt
Code:

MAILTO=myemailadd@yahoo.com
13 21 4 8 3  /bin/sh qwe.sh

then typed
Code:

crontab crontab.txt
where qwe.sh contains->
Code:

#!/bin/sh
mkdir DONE

It worked and created the dir DONE !
then i changed the time in crontab.txt
and ran it again !
this time the dir DONE exists so it should send me a email containing error info
but i am not receiving any email !!

now 2nd prob
2)
i have changed the script qwe.sh to

Code:

#!/bin/sh
nautilus

and ran the crontab.txt (incrementing the time)
but cron is not opening nautilus

i have also tried

Code:

#!/bin/sh
deluge-gtk

this code also not opened deluge

hotborad 08-04-2010 11:50 AM

weird i dont know this language but i looked it up on another website
http://adminschoice.com/crontab-quick-reference
or maybe
http://www.zytrax.com/tech/survival/cron.html
or
http://www.unixgeeks.org/security/ne...ix/cron-1.html
or i know most people hate wiki but heres wiki
http://en.wikipedia.org/wiki/Cron

sorry i haven't learned this language but i hope one of these websites helps you but it looks correct from what I have read but if i were you id retry them a few times just incase you messed up a word like bin and wrote bun happens to me in C++ all the time and good luck

michielv 08-04-2010 04:00 PM

You can find the answer to your second question here: http://ubuntuforums.org/showthread.php?t=185993

sem007 08-05-2010 02:29 AM

Quote:

this time the dir DONE exists so it should send me a email containing error info
but i am not receiving any email !!
You need to setup mail server to send mail to other domain.
Quote:

now 2nd prob
2)
i have changed the script qwe.sh to

Code:

#!/bin/sh
nautilus

and ran the crontab.txt (incrementing the time)
but cron is not opening nautilus

i have also tried

Code:

#!/bin/sh
deluge-gtk

this code also not opened deluge
write absolute path in crontab file and script

exa.
#!/bin/sh
/usr/bin/nautilus


HTH

rhklinux 08-05-2010 10:47 AM

thanks all , link given by michielv solved my second question !!

rhklinux 08-05-2010 01:19 PM

for 1st :I had installed evolution , created account using pop3,name of account is my email id itself ,so now when i executed the crontab.txt(qwe.sh contain mkdir DONE which already exists),but i have not received any mail,so what is going wrong ??
thanks in advance !!

sem007 08-06-2010 03:43 AM

plz. read post #4.

rhklinux 08-06-2010 05:20 AM

i don't know how to setup mail server to send mail to other domain.

sem007 08-06-2010 05:28 AM

Tow way to configure mail server to send mail other domain.
1 -> use pre-configured SMPT (mail server) to sendmail
2 -> register domainname and configure your own mail server.

If you have mail server(option 1) then you can install postfix as satellite mail server to send mail outside of domain using other SMTP server.

rhklinux 08-06-2010 08:26 AM

i am using smpt to send mails successfully using evolution mail client but cron is not sending me any mails
thanks for the interest !!

sem007 08-06-2010 08:58 AM

Hmm... Install postfix and select satellite server when it prompt during installation(in debian, ubuntu). If postfix already installed then reconfigure using

Code:

dpkg-reconfigure postfix


All times are GMT -5. The time now is 11:32 AM.