evelin wrote:
>> Use crontab. See the man page. -- Alan
>>
>> evelin wrote:
>>     
>>> ok i found how to shutdown the network with
>>>       
>> ifconfig ( card) down and to use it again i use
>> ifconfig ( card) up, is there a form to make an
>> script like a timer so it passes some time and it use
>> the first command ifconfig down and after 1 hour it
>> uses ifconfig up?
>>     
>>>   
>>>       
>> _______________________________________________
>> opensolaris-help mailing list
>> opensolaris-help at opensolaris.org
>>     
>
> hello, i dont really know how to make an scriot i looked contrac but i dont 
> get it, can u please explain it a little bit more easy with yust the things i 
> want, please
>   
Not contrac - crontab.

cron is one of the oldest of Unix utilities, found on all modern 
variants today.  It's a scheduler.  It schedules things.

cron reads a crontab - a dedicated file defining what should be run, 
when to run it, how often it should be re run after that etc.

If you don't have script writing skills, you can have crontab schedule 
the ifconfig (card) up/down commands directly.

Running a "crontab -l" will list the current user's crontab.

The simplest way for me to explain changing a crontab is - log on as the 
account who's crontab you wish to modify (i.e. the account who has the 
access to run the commands you want) and run "crontab -e".   This will 
launch the default text editor and allow you to start modifying that 
account's crontab file.

The crontab file has a specific format, which is documented at 
http://en.wikipedia.org/wiki/Cron#Operators.  If you've never used cron 
before, I'd recommend reading that whole page.

If that doesn't get you out of trouble here are some examples:

To run a 'ifconfig (card) down' at 3pm and a 'ifconfig (card) up' at 
5pm, add the following two line's to root's crontab:

0 15 * * * ifconfig (card) down
0 17 * * * ifconfig (card) up

Of course, replace (card) with the name of the NIC you actually want to 
take down/up.

If you only want to perform those commands on card called e1000g0, and 
only on weekdays (Monday to Friday), then add these to root's crontab:

0 15 1-5 * * ifconfig e1000g0 down
0 17 1-5 * * ifconfig e1000g0 up

Running "man cron" and "man crontab" will give you further information 
as well.

Regards,

Stewart

Reply via email to