How may I automatically stop and start Mail services at a set time please

Hi folks. I was wondering if anyone could tell me how to automatically stop and start Mail services (or any other services) at a set time please in Leopard Server? Is there a script someone has created which might help?
Cheers, David ( a realy newbie when it comes to administering OS X server)

launchd works through a series of XML documents that define tasks to run, either at launch, on a time schedule, in response to network events, etc.
So you'll need to create two .plists - one to start the mail server and one to stop it. They should be saved in /Library/LaunchDaemons. I'd suggest something like:
/Library/LaunchDaemons/local.postfix.stop.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple
.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>local.postfix.stop</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/sbin/serveradmin</string>
    <string>stop</string>
    <string>mail</string>
  </array>
  <key>StartCalendarInterval</key>
  <dict>
    <key>Hour</key>
    <integer>1</integer>
    <key>Minute</key>
    <integer>00</integer>
  </dict>
</dict>
</plist>
and /Library/LaunchDaemons/local.postfix.start.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple
.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>local.postfix.start</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/sbin/serveradmin</string>
    <string>start</string>
    <string>mail</string>
  </array>
  <key>StartCalendarInterval</key>
  <dict>
    <key>Hour</key>
    <integer>4</integer>
    <key>Minute</key>
    <integer>00</integer>
  </dict>
</dict>
</plist>
You'll need to either use launchctl load /Library/LaunchDaemons/local.postfix.stop (or start) to load the tasks, or reboot your server.
I'm curious, though, as to why you want to do this. Mail is typically one of the services that people want to run 24/7 so they don't miss out on any emails (even though SMTP can tolerate this). Why do you want to shut yours down?

Similar Messages

  • How come when I stop and start an audio clip before its done...

    How come when I stop and start an audio clip when before its done, that when I play it it only plays part of the file?

    I'm not sure if I got you right, but do you mean that it's like pausing...
    I have never played an audio clip with java, but if this is the case, maybe you have to rewind the clip.
    /J Lindroos

  • How to Stop and Start Scheduler Service

    Does anyone know how to stop and start the Scheduler service for Hyperion Financial Reporting in release 9.3.1?

    please see the metalink note
    How to Start/Stop MWA Services Using Control Scripts adstrtal.sh/adstpall.sh? [ID 731320.1]
    This is how i startup and shutdown WMA
    for stopping :
    1) login to Applications tier
    2) To see if the MWA (telnet) server is running use:
    ps -ef|grep DPID
    3) cd $MWA_TOP/bin
    3) ./mwactl.sh -login sysadmin/xxxxx stop_force 10200;
    4) check the wma process from OS level
    ps -ef|grep mwa
    for starting
    1) login to Applications tier
    2) cd $MWA_TOP/bin
    3) ./mwactl.sh -login sysadmin/xxxxx start _force 10200;
    4) check the wma process from OS level
    ps -ef|grep mwa

  • Task created to stop and start Health service not working.

    We have multiple servers being grayed out so we created a task to stop and start the health service on SCOM 2007 R2. We have created two tasks one to stop and another task to start. The STOP task works but the START tasks keeps running but there is no result
    as well as when i check in Services.msc it is still stopped. Below are the screen shots .
    Task created to STOP the health service which is running.
    Screen shot of service start task creation which is NOT working
    The same was created for another service windows audio. Which worked for both stop and stop (Created separate tasks).
    We also tried the recycle health service and chche which is also failing.
    Can any one please help. The issue is on both SCOM 2007R2 and 2012 R2 both. Is there any other way to touch the health service.
    We are facing the issue only with Healthservice.

    Hi All,
    Thank you for all your answers.
    @ dktoa -
    You are right we have to concentrate on the servers to determine why do they go grey (all in one site). But before we do that i felt i find a temporary solution. Then go deep investigation to solve the issue.
    @Yan LI: As per the likn provided above you. I overrided the servers but still the health services were not starting or restarting. When i created a custom group and added the servers to that  group in that site and then  enabled the override on Restart
    Health Service for a specific group and pointed towards that group then it worked.
    Thanks All.

  • Scripts to notify stop and start of services

    dear all,
                 i m looking for a script to send me a mail whenever oracle apps service is shutdown and start.your help will be appreciated thanks in advance.
    os:rhel6
    ebs :12.1.3
    db:11.2.0.3

    The full order list can be found at :- http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_install/ch05s02.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Xperia Z1 keeps shutting down does not restarts,and automatically stops and starts charging randomly

    My Sony Xperia Z1 keeps shutting down due to high temperature even though its not overheated, or i am not running any app. It does not restarts even after i give it some time to cool down as it soon again displays the same messege (SHUTTING DOWN DUE TO HIGH TEMPERATURE), then when i connect a charger it automatically starts charging and discharging (even though if the charger is connected and ON) the cell phone
    I request you to kindly look into the matter, expedite the situation and suggest me any possible solution asap
    also i would request you to not to release any OS updates unless they are fully stable and functional, i have bought this device 6 months back and it has already malfunctioned 3 times which is a serious concern. I cannot keep on updating and repairing my cell phone after every month or so which i feel is very irritating.
    Please stop treating these devices as developers guinea pigs

    I suggest that you try to repair the phone software using PC Companion..
    Before repairing your device you may want to backup your information first. Check out this topic for more information on how to.
    How to backup?
    If the issue should still remain I think that this needs to be examined and fixed at a repair center. For more information about how to submit your phone for repair and where, contact your local support team.
     - Official Sony Xperia Support Staff
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • Upgraded to 11.1.4.62.  Now iTunes is saying "An iPod has been detected, but could not be identified properly.  Disconnect then reconnect ..."  I removed iTunes and reinstalled.  I stopped and started the service.  I reset the iPod.  When I put it in disk

    I upgraded to 11.1.14.62 this morning.  Not iTunes is saying "An iPod had been detected but could not be identified properly".  I unlugged/replugged in.  I reset the iPod, I removed iTunes and reinstalled.  I'ver tried three different cables.
    When I put the iPod in disk mode it shows up briefly as a disk then goes away.
    Any ideas?

    Hi there  - I've spoken with Apple and here is their response (worked for me). You need to uninstall not only iTunes, but also (in this order):
    1) iTunes
    2) Apple Software Update
    3) Apple Mobile Device Support
    4) Bonjour
    5) Apple Application Support
    Then you restart your computer.
    Then you install the latest version of iTunes (which will reinstall all those things you uninstalled).
    Then you restart your computer again.
    Mine is working perfectly again now.
    I hope it works for you,
    Carmen.

  • Communication Channel Stop and Start

    Hello everyone,
    We are using XI along with MQ for queing messages to our 3rd party logistics. Due to some issues happened in the past, it is decided to stop and restart the MQ channels every weekend. Now the problem is, when the MQ is down, some of the XI communication channels will go down,  and will not start automatically, when the MQ bounces back. Now this had created a manual activity every weekend to stop and start all communication channels.
    Question is, is there any way we can schedule it as a job to stop and start the channels, at a specific time ?

    Hi!
    It is possible in scheduling the messages in XI...
    1.  But before doing this make sure that at what time you want to be schedule ?
    2.  Is that time will be uniform for every week or else is it may varies ?
    3.  If Uniform please make schedule or else if it is varying note the difference between those timings I mean
         If your Messages are flowing for every Tuesday and also every Thursday...., etc..
    4.  You can schedule what ever may be the time it is suppose if those timings are varying weekly once a
         day but in that single day or next day if it was more than once..then better scheduling the
          communication channels to be start for and to be process for that particular 2 days and remaining days
          it wont work I mean stopping Cc
    5. Now when come to process...in scheduling...
    a) Click RWB>Component Monitoring>Communication Channel monitoiing
    b) Right side u can check Availability TIme planning option click that..a seperate window will opens
        THere u can observe these options..
    c) also u can see the log
    I hope it will be useful to you...
    Availability plan--> ONCE /DIALY / WEEKLY/ MONTHLY based on your req select any one...
    Create: to create the scheduling...
    change: to change the existing one
    Save: to save
    Reset if u want toreset alll
    Delete and copy also as u know these..
    While creating you can again see these options 3 main TABS
    details:  --> Corresponding details
    CC: select ur chanel
    OPTION 2
    In XI 3.O you can directly do scheduling there after selecting the radio button of any Comunication channel and there adjacent to Audit log u can see availability time plan other than rt side top corder..
    I hope it will be useful to u
    Regards
    Amar Srinivas Eli

  • Stop and Start Essbase 11.1.2.2 services

    Hi All
    How to stop and start essbase 1.1.2.2 services? Do I just stop and start OPMN service? Or got to start menu and Oracle EPM System and Essbase to stop and start? Will both work?
    Thanks

    Yes you can just stop and start the OPMN service, the start menu option will do pretty much the same thing, for more information have a read of http://docs.oracle.com/cd/E17236_01/epm.1112/epm_install_1112200/ch12s02s08.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Order of stop and start of reporting services

    Hi All,
    I am using 11.1.1.3 version in my laptop,i want know the correct order of stop and start the services,please help me on this.
    Thanks
    Hypuser

    The full order list can be found at :- http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_install/ch05s02.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Stop and Start Services

    Hi All,
    We are stopping and starting the services for daily backup. Is it advisable to stop and start services.
    Because client wants to stop the services before taking the backup anf start the services after backup.
    In this scenario, what services do we need to stop for backup process.
    Regards,
    Kumar

    Hi Saichand,
    Thanks for the response.
    Do u have any idea on the below:
    Our scenario is the below:
    We have a daily back of BI folders and Loading data from ERP to 10g database.
    We logged in with remote desktop user A from ABC system to BI system and We created a batch file to start and stop all the BI the services and scheduled this batch file using windows schedule tasks. These batch files will stop the BI services and after 30 minutes another batch file will load data into the database, after 2 hours start services batch file will start the BI services.
    When we open the BI Dashboards in the morning, all the dashboards and reports are working fine. But when I login to BI system, OC4J windows is not visible and dashboards are not coming and when we check the logs, LOGs says OC4J is running.
    Please suggest us the solution.
    Regards,
    Kumar
    Regards,
    Kumar
    Edited by: user597882 on Aug 26, 2010 3:35 AM

  • How to stop and start only the process of Oracle Application Express?

    I'd like to know how to stop the process of Oracle Application Express on my server installed oracle express package.
    After installed Oracle Express edition, not only oracle database server processes but also Oracle Application Express, such as http server, is started automatically...
    I hope to stop and start Application Express on demand but is this feature enabled?

    Oracle Apex is an API, if that helps you understand / visualize. You do not start Apex process nor stop it.
    When an Apex session starts it starts calling the API.
    You can however start / stop the listener. It may be OHS, ApexListener and the J2EE container running it, OC4J or any other "server" that you are using.
    The built-in EPG is something like an API again, you cannot start / stop it but you can disable/enable it with DBMS_XDB.SETHTTPPORT API.
    Regards,

  • How to stop and start MDBs to listen for JMS messages

    Hello! This might be more of an architecture question rather than a technical questing, but I post it here, in the lack of a better place...
    For several years I have been using Webster and Webster MQ to send messages back and forth to clients. The architecture for the middleware platform has been designed around the functionality of ListenerPorts. Listenerports is a Webster functionality that let you "stop" and start to listen to JMS messages for a given MDB either by admin console, or by JMX.
    The arhitecture we used was something like this :
    1.Client sends a persistent message to a queue. (order)
    2. An MDB pics up the order message, calls a SessionBean that "fronts" the IIOP back end system.
    This is quite "out of the box" architecture, but we used the Listenerports to solve a stability problem for our back end system.
    The backEnd system was quite unstable, so the EJB threw an exception (typically because of timeout or connection refused) back to the MDB.
    The Listenerport was "defined" to handle 3 errors before stopping, so the MDB resent the message twice before the listenerport automatically stopped. The nice thing about this feature was that the client could continue to send orders, and was not bothered when the back end system was down.
    When the backEnd system was up and running, we could start the listenerport and it was all back to normal state. We even had a start script that checked the state of the listenerport every 30 minute, and started it automatically if it was stopped, making the admin task of starting the MDB unnecessary..
    Now.. Why am I telling this story..
    I would like to know how this could be done using "clean" J2EE technologies..That is..Not using any technology that is not portable..
    I`m playing with glassfish at home, and it struck me that there is nothing in the J2EE spec that defines the functionality described above ? Am i missing something ?
    I Do not want to stop My application because the back end system is down? That is the only way (i know of) that i can "stop" to listen for messages..
    I can put all the messages on an error queue when the backbend system is down, but that would lead to more code just to handle the error messages. Maybe the easiest way to solve this is to "move" (programmatically) all messages from the error queue over to the "standard" queue every XX minute, but somehow that sounds "wrong"
    Can anyone give me some advice to how this problem situation should be solved ? I`m interested in the solution both from an architectural perspective and from a more technical perspective..
    Best regards
    Hans-Jacob Melby

    Breakpoints, whether normal or conditional, are just meant for debugging of your code.  I had the sense from your question that the pausing you want to do is a part of normal operation of your code.  I would NOT recommend using a breakpoint for that situation.  It would bring up the block diagram showing the breakpoint when it occurs.  A user besides the programmer would not know what to do in that case.
     Yes, both the inner and outer loops would have shift registers.
    Putting a case structure with a small while loop inside the "Pausing Case" is doable.  It just depends on what you are doing or waiting for while the program operation is "paused".

  • How to stop and start process SAPOSCOL

    Hi, i have a problem with write access for saposcol program. I see that the file saposcol is read the file but its unable to wirte the same.
    Collector           : running
    Start time coll.    : Mon May 21 17:49:49 2007
    Current Time        : Mon Jun 11 13:27:51 2007
    Last write access   : Tue May 29 06:23:46 2007
    Last Read  Access   : Mon Jun 11 13:26:24 2007
    When i try to stop the saposcol i get the following error:
    igzadm> saposcol -k
    Setting Stop Flag :
    13:24:44 11.06.2007   LOG: ==== Stop Flag was set by saposcol (kill_collector()).
    13:24:44 11.06.2007   LOG: ====  The collection process will stop as soon as possible
    can't kill process 409656.
    kill: No such process
    ERROR:No reaction from collecting process 409656.
          Please kill collecting process.exes.
    Am doing this command through SID<ADM> from change directory /run.
    Please help me how to check the permission of the SIDADM to stop the services.
    I also try the same from root user but now use..
    Please guide me how to stop and start the SAPOSCOL in AIX 5.3.
    Advance Thanks.
    Suri Tyson

    Hi, i have the following permission for saposcol
    imserv:/ # ps -ef | grep saposcol | more
        root  118842  528422   0 14:02:17  pts/2  0:00 grep saposcol
    I have changed the ownership as you mentioned....
    imserv:/usr/sap/IGZ/SYS/exe/run # ./saproot.sh igz
    Preparing /usr/sap/IGZ/SYS/exe/run/brbackup ...
    Preparing /usr/sap/IGZ/SYS/exe/run/brarchive ...
    Preparing /usr/sap/IGZ/SYS/exe/run/brconnect ...
    Preparing /usr/sap/IGZ/SYS/exe/run/brtools ...
    Preparing saposcol ...
    Preparing icmbnd ...
    done
    However, i still get the error as:
    igzadm> saposcol -k
    Setting Stop Flag :
    14:12:13 11.06.2007   LOG: ==== Stop Flag was set by saposcol (kill_collector()).
    14:12:13 11.06.2007   LOG: ====  The collection process will stop as soon as possible
    can't kill process 409656.
    kill: No such process
    ERROR:No reaction from collecting process 409656.
          Please kill collecting process.
    Now the permission are set in my system as:
    igzadm> ps -ef |grep saposcol|more
      igzadm  729196  983058   0 14:13:25  pts/2  0:00 grep saposcol

  • How to STOP and START the BO EXPLORER/POLESTAR - LINUX

    Dear friends,
    Could you please let me know on How to STOP and START the BO EXPLORER/POLESTAR on LINUX platform?
    Thank you,
    Nikee

    Oracle Apex is an API, if that helps you understand / visualize. You do not start Apex process nor stop it.
    When an Apex session starts it starts calling the API.
    You can however start / stop the listener. It may be OHS, ApexListener and the J2EE container running it, OC4J or any other "server" that you are using.
    The built-in EPG is something like an API again, you cannot start / stop it but you can disable/enable it with DBMS_XDB.SETHTTPPORT API.
    Regards,

Maybe you are looking for

  • Adobe Bridge CS6 undefined in not an object Help Please

    I am so sick and tired of getting this error message when I try to create a pdf contact sheet - undefined is not an object.  Can someone help me? What frustrates me the is there is no log file telling me what image has the problem which Bridge does n

  • I need to know the diferences From My SAP 4.7  to ERP 6.0

    Some one  know a link where. I'll found diferences from  My SAP 4.7 to ERP 6.

  • How to make a field on the screen of any transaction 'display only' in BADI

    Hello All, I am working on BADI. The requirement is that for a specific condition, the user should not be able to change the 'plant' field on the screen of the standard MM transactions ME22N or ME23N. The field 'plant' should be grayed out and the us

  • JDBC Syncron message whit Update and select

    Hi. I'm trying to make an syncron (RFC <==> JDBC) message where I got an request from an RFC. This request should update an DB and then return with the updated fields. The updata works fine, but I did not get the changed fields back in my responsmess

  • Need a mapping program

    Just switched to a Mac from a PC. I need to find a mapping program similar to Microsoft Mappoint. Can't seem to find anything that will sub for this, any help out there???