LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-23-2007, 12:06 PM   #1
antivirus
Member
 
Registered: Feb 2007
Location: Bangladesh
Distribution: Fedora Core 9
Posts: 59

Rep: Reputation: 15
Task Scheduling on linux


Hi
Im a new user of linux. I want to know more about corn. Please help me. Every night at 9pm i want to execute "ifup eth1" and every morning at 9am i want to execute "ifdown eth1" command what will i do. Do i have to change SHELL, PATH, HOME's value?
 
Old 02-23-2007, 12:35 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
You have to place an entry in /etc/crontab to execute the comand that you want at the time that you want. Here is an explanation on how to do that:

http://www.pantz.org/os/linux/programs/cron.shtml

You also have to create a command and have the crontab line execute that command. I suggest that you give the full path to the command in the crontab entry rather than try to change the PATH used by cron.

----------------------
Steve Stites
 
Old 02-24-2007, 09:52 AM   #3
antivirus
Member
 
Registered: Feb 2007
Location: Bangladesh
Distribution: Fedora Core 9
Posts: 59

Original Poster
Rep: Reputation: 15
Thanks for your reply. Got another trouble with permission. Whenever cron tyies to execute my command it gives an error like

"exec permission denied mycommand"

On which file i have to change premission. Have any idea bout this things?
 
Old 02-25-2007, 10:25 PM   #4
the.madjack
Member
 
Registered: Apr 2006
Distribution: Slackware 10.2
Posts: 52

Rep: Reputation: 15
Quote:
Originally Posted by antivirus
Thanks for your reply. Got another trouble with permission. Whenever cron tyies to execute my command it gives an error like

"exec permission denied mycommand"

On which file i have to change premission. Have any idea bout this things?
did you run the command as root?
 
Old 02-25-2007, 10:36 PM   #5
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Yes, ifdown would need to be run as the root user, so must be placed in the root crontab (or run through sudo, though the root crontab probably makes more sense).
 
Old 02-26-2007, 11:17 AM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"exec permission denied mycommand"

You need to set the permissions for your command to executable. Use the chmod command. For example:

chmod +x /myprogs/mycommand

See:
man chmod

---------------------
Steve Stites
 
Old 02-27-2007, 07:48 AM   #7
antivirus
Member
 
Registered: Feb 2007
Location: Bangladesh
Distribution: Fedora Core 9
Posts: 59

Original Poster
Rep: Reputation: 15
Thanks!!!
Again @jailbait. I just changed that file permision as u said and its working...........
 
  


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
Task bar no longer shows task Richard Rahl Linux - Newbie 3 04-12-2010 09:39 AM
Scheduling in Linux asurya Linux - General 5 08-31-2005 08:34 AM
at (the task scheduling program) won't work using regular user BL/|CK S3RP3NT Linux - Software 3 03-20-2005 03:32 AM
Task Scheduling jeffkjo Linux - Software 4 12-02-2004 09:37 AM
Linux Scheduling Kumar Programming 3 06-14-2004 04:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:33 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
Open Source Consulting | Domain Registration