LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   configuring the cron daemon (https://www.linuxquestions.org/questions/linux-newbie-8/configuring-the-cron-daemon-502843/)

skylimit 11-18-2006 04:09 PM

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

acid_kewpie 11-18-2006 04:22 PM

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?

matthewg42 11-18-2006 04:27 PM

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.

skylimit 11-18-2006 05:00 PM

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.

tim1348 11-18-2006 05:19 PM

This command will work at boot time, place it in rc.local;

echo "Hello World"

matthewg42 11-18-2006 05:23 PM

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)?

skylimit 11-26-2006 04:00 PM

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.

matthewg42 11-27-2006 08:46 AM

You can put your code in /etc/rc.local

acid_kewpie 11-27-2006 12:32 PM

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

matthewg42 11-27-2006 12:44 PM

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


All times are GMT -5. The time now is 12:29 PM.