LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-04-2010, 11:14 AM   #1
rhklinux
Member
 
Registered: Jan 2010
Location: india/pune
Distribution: Arch Fedora20
Posts: 126

Rep: Reputation: 18
Question cron


Hi,

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

Last edited by rhklinux; 08-04-2010 at 11:16 AM.
 
Old 08-04-2010, 11:50 AM   #2
hotborad
LQ Newbie
 
Registered: Aug 2010
Posts: 11

Rep: Reputation: 1
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

Last edited by hotborad; 08-04-2010 at 11:56 AM.
 
0 members found this post helpful.
Old 08-04-2010, 04:00 PM   #3
michielv
LQ Newbie
 
Registered: Feb 2009
Location: Belgium, Antwerp
Distribution: Mint
Posts: 25

Rep: Reputation: 1
You can find the answer to your second question here: http://ubuntuforums.org/showthread.php?t=185993
 
Old 08-05-2010, 02:29 AM   #4
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
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
 
0 members found this post helpful.
Old 08-05-2010, 10:47 AM   #5
rhklinux
Member
 
Registered: Jan 2010
Location: india/pune
Distribution: Arch Fedora20
Posts: 126

Original Poster
Rep: Reputation: 18
thanks all , link given by michielv solved my second question !!
 
Old 08-05-2010, 01:19 PM   #6
rhklinux
Member
 
Registered: Jan 2010
Location: india/pune
Distribution: Arch Fedora20
Posts: 126

Original Poster
Rep: Reputation: 18
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 !!
 
Old 08-06-2010, 03:43 AM   #7
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
plz. read post #4.
 
Old 08-06-2010, 05:20 AM   #8
rhklinux
Member
 
Registered: Jan 2010
Location: india/pune
Distribution: Arch Fedora20
Posts: 126

Original Poster
Rep: Reputation: 18
i don't know how to setup mail server to send mail to other domain.
 
Old 08-06-2010, 05:28 AM   #9
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
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.
 
Old 08-06-2010, 08:26 AM   #10
rhklinux
Member
 
Registered: Jan 2010
Location: india/pune
Distribution: Arch Fedora20
Posts: 126

Original Poster
Rep: Reputation: 18
i am using smpt to send mails successfully using evolution mail client but cron is not sending me any mails
thanks for the interest !!
 
Old 08-06-2010, 08:58 AM   #11
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron.hourly cron.weekly cron.monthly and 0anacron. Are they necessary? glore2002 Debian 2 09-30-2009 08:57 PM
Cron appears to be messed up (E: cron: subprocess post-installation script returned e bujutsukai Linux - Newbie 1 07-24-2008 03:39 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration