LinuxQuestions.org
Visit Jeremy's Blog.
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 11-18-2006, 05:09 PM   #1
skylimit
Member
 
Registered: Nov 2006
Location: England
Distribution: Slackware, Ubuntu feisty
Posts: 41

Rep: Reputation: 15
configuring the cron daemon


Hi all, im a bit stuck on something. Basically im trying to configure cron so that when i reboot my system it will print e.g "Hello World". anyone able to help me out here? any responses appreciated.

edit:im running CentOS 4.4

Last edited by skylimit; 11-18-2006 at 05:10 PM.
 
Old 11-18-2006, 05:22 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
rebooting your system has nothing to do with cron. infact it's directly unrelated. cron is to do things on a 100% time based schedule and takes no bearing at all from what the system is doing at the time. cron couldn't care less if you're box just rebooted. where do you want to print this message? what functionality are you trying to achieve?
 
Old 11-18-2006, 05:27 PM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
I'm not sure that cron is really what you want to be using. Cron is for executing program periodically based on a schedule, not per boot.
 
Old 11-18-2006, 06:00 PM   #4
skylimit
Member
 
Registered: Nov 2006
Location: England
Distribution: Slackware, Ubuntu feisty
Posts: 41

Original Poster
Rep: Reputation: 15
scheduling and running tasks

Quote:
Originally Posted by acid_kewpie
rebooting your system has nothing to do with cron. infact it's directly unrelated. cron is to do things on a 100% time based schedule and takes no bearing at all from what the system is doing at the time. cron couldn't care less if you're box just rebooted. where do you want to print this message? what functionality are you trying to achieve?
thanks for your replies. I probably presented the question wrongly. Im trying to see if I can schedule tasks to run at a specific time (in this case a message say "hello world" to be printed when the system is rebooted). not quite sure how to do this using cron, at, batch or anyother command available. responses appreciated

edit: hope i put it rite this time.
 
Old 11-18-2006, 06:19 PM   #5
tim1348
Member
 
Registered: Oct 2006
Distribution: Slackware 11
Posts: 46

Rep: Reputation: 15
This command will work at boot time, place it in rc.local;

echo "Hello World"
 
Old 11-18-2006, 06:23 PM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
Where would you like the message to be printed? On the console at boot (text messages that scroll up the screen at boot time), or a graphical dialog box after you log in? If you want a dialog to appear after login, can you tell us what desktop environment you're using (KDE, GNOME etc)?
 
Old 11-26-2006, 05:00 PM   #7
skylimit
Member
 
Registered: Nov 2006
Location: England
Distribution: Slackware, Ubuntu feisty
Posts: 41

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by matthewg42
Where would you like the message to be printed? On the console at boot (text messages that scroll up the screen at boot time), or a graphical dialog box after you log in? If you want a dialog to appear after login, can you tell us what desktop environment you're using (KDE, GNOME etc)?

thanks in advance. I'd like the msg to be printed on the terminal at boot time.
 
Old 11-27-2006, 09:46 AM   #8
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
You can put your code in /etc/rc.local
 
Old 11-27-2006, 01:32 PM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
yeah you can put it there, about the only place it could go, but I can't really imagine it's going to be any use... it'll fly past the screen, and as soon as your login shell loads, it's gone, so would only be visible on screen for literally a second i'd guess.


Ahh the joys of not being given real live examples..
 
Old 11-27-2006, 01:44 PM   #10
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
If you want something to appear on each VT prior to login (i.e. printed above the login: line), put text in /etc/issue. If you want it to appear just after login on virtual consoles, put it in /etc/motd (motd stands for message of the day).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
uClinux cron/daemon help Pyrofeed Linux - Newbie 1 02-25-2006 07:22 AM
How does cron daemon work? smart_sagittari Linux - General 5 01-26-2006 09:40 AM
Can the output of cron daemon be sent via other smtp hamish Linux - Software 0 09-02-2005 09:28 AM
Cron Daemon error? Help please plisken Linux - General 0 08-27-2003 06:57 PM
[SuSE] 'Netdate': Cron Daemon Error DavidMD Linux - Distributions 6 06-18-2003 05:33 PM


All times are GMT -5. The time now is 04:18 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration