Applescript running at a specific time of day

I have a headless server. If it fails to shut down I want to run script that would force it to shut down.
The shut down script I have.
tell application "System Events"
shut down
end tell
or if needed
do shell script "shutdown -h now" password "YourAdminPwd" with administrator privileges
However if I would like his to execute at lets say 24.00 hours what would I need to do to have that happen?
Do I need to have it run to do so?
What script?
See I do not want to use iCall to execute it as this might be the reason the shut down failed in the first place (the server sometimes hangs on shut down as a programme wants a confirmation). and than the script does not run (is what is happening at the moment if I simulate a hanging program)
Thanks

Thanks Andrew for your help
Andrew99 wrote:
I trust you're aware of the consequences of the "quit without saving" command -- any open documents with unsaved changes will be lost -- but it would appear that this is not an issue for you in this case. Others should be forewarned.
I am and yes no issue as the server is doing its stuff 'serving'. if it hangs on lets say an email, it wil send it again next time it is up as Mail has it already in the outbox. (mail gets generated by a script, so it could only hang because of my internet connection being down). ditto with Fax, answering machine print-servers etc.
Andrew99 wrote:
In repeated tests, I intentionally left unsaved documents open in both Mail and TextEdit. On a schedule I chose in iCal, each time, as hoped for, all applications quit and my Mac immediately shut down, and did so without an application warning or a shut down warning dialog appearing.
it works for me too!
Andrew99 wrote:
tell application "Finder"
shut down
end tell
If my scripting knowledge is correct, than this line is the equivalent of me telling the machine to shut down using te 'Shut Down' command. correct? this is not a "Killall" type command?
So it is normal 'soft' shut down, the only difference being that it skips the dialogue box bit.
Am I correct?
And thanks for taking the time!

Similar Messages

  • FDM Script - Set to run at a specific time of day??

    Can you set an FDM script to run at a certain time of day (based on
    server time)? I've currently got a Custom/General script I'd like to
    run once a day at a set time.
    Thanks!

    You need the use task manager for that.
    I suggest you look in the admin guide for more info.
    If I’m not mistaken, you need to enable in the application setting and then you can use it from the tools menu in the Workbench.

  • Applescript ical event at specific time of day

    I'm trying to find a way to have a script create an iCal event for a day away. I use (current date + 1 * days) but this creates the event one day away at the time the script runs. is there a way to create the event one day away at 8:00am each time?

    The current date includes the time, so you can just set the time separately, for example
    set theDate to ((current date) + 1 * days)
    set time of theDate to 8 * hours
    theDate -- > next day at 8:00AM

  • Scheduling specific time of day for automatic software updates

    How can one schedule a specific time of day (i.e. between 11:01 pm to 5.59 am when I have unlimited download availability) for an iMac to search for automatic software updates? System preferences only offer frequency, but no time option. If it is possible to schedule a specific time, will invoking the feature override the sleep function, wake up the machine and perform the software update and then let the machine go back to "sleep?" Thank you for all your help.

    to clarify barney's suggestion, the following terminal command will download all available updates and put them in your Downloads folder.
    softwareupdate -d --all
    so what you need to do is this.
    1. turn off automatic software update in software update system preferences.
    2. make a cron or a launch daemon to run the above terminal command periodically at the time of your choosing. to make a launch daemon I recommend using lingon http://tuppis.com/lingon/
    The daemon will only run if the computer is not asleep at the scheduled time so you might want to set to to wake/start shortly before that. this is done in system preferences->energy saver->schedule.
    to install the updates once they are downloaded double-click on the pkg files and follow the instructions.

  • Schedule job to run daily at specific times

    Hello,
    Not sure if this is the correct forum to post my question. If not, please advise which forum to use.
    How can I setup a background job which runs daily day, but only runs between a specific time?
    Our request is to have a job to run daily between 0700 - 1700 - then end and restarts again at 0700 the next day. How can we do this?
    Kind regards

    Check this
    https://forums.sdn.sap.com/search.jspa?threadID=&q=backgroundANDjobANDschedule&objID=f50&dateRange=all&numResults=15
    PS Please make a search this forum before posting

  • Render at a Specific Time Every Day

    Is there a way to have a specific Final Cut Pro project to render automatically at a specific time every day?
    I work at a CG house, and shots are updated at random intervals, but are always in a fixed, specific location. So by rendering out the project everyday we would always have an up to date complete edit. And by automating it it could be rendered off hours and be ready first thing in the morning for review.

    Or page 548 of Volume III, if you're on Final Cut Pro 5 (FCStudio 1).
    'Main Menu/Final Cut Pro/User Preferences/General tab'
    FCS2 may allow specific time of day, but FCS1 simply lets you set a period of time (while the program is open, but idle). So set it for 2 hours, leave FCP open when your last editor leaves the office.
    This also offers several choices on which sequences you actually want to 'auto-render'.
    K

  • Is it possible to schedule updates for a specific time of day like 12am?

    Is it possible to schedule updates for a specific time of day like 12am?

    No. If you use Automatic Updates, the apps update when the updates are available. Read this for a little more information.
    http://9to5mac.com/2013/09/20/ios-7-how-to-set-up-automatic-app-updates/

  • Is there a specific time of day that the BTO iMacs become available for pickup?

    As I am sure many people can relate to, I find myself hitting the refresh screen on my Apple order page awaiting the arrive of a built-to-order 27" iMac (3.4 GHz/ 32GB memory/ 3TB fusion/ 680MX graphics). Question for people with an inside scoop.... do the custom macs arrive a specific time of day (many retailers have scheduled deliveries at specic times during the day). The reason I ask is because if my Mac is only going to become "available for pick-up" in the morning, I will know that after... let's say 10am.. there is no reason for me to keep checking because I will know it won't be showing up on this specific business day, if it hasn't already. Any insight on how this works? Thanks fellow Apple fans!

    Goodness gracious.... Not even 5 minutes after I replied to you, my item became available for pickup! It's like they were listening in! haha !

  • Start a process at a specific time of day

    Is there any kind of a time mechanism that will allow a process to be started at a specific time each day?

    There is not a scheduling mechanism native to LC/ADEP. A valid approach would be to use a cron job or WMI (Windows Management Instrumentation) to start a batch file that calls a Java class that uses the LC Java API to invoke the short-lived process.
    See http://help.adobe.com/en_US/enterpriseplatform/10.0/programLC/help/index.html
    Invoking Document Services Using APIs > Invoking Document Services Using the Java API > Quick Start: Invoking a short-lived process using the Invocation API
    Steve

  • Interface to run at a specific time

    Hi
    I am trying to let a interface run at a specific time, I have setup the bpm and will probable use the wait step? Is this the way to go, because I was thinking of setting my sender adapter to run let's say every 2 hours and then when it reach 10pm it will let all the data go to the end point?
    Thanks in advance
    Clinton

    Hi,
    you can collect all of your messages
    (before BPM) and then at 10 let all then start the BPMs
    /people/alexander.bundschuh/blog/2006/01/04/scheduling-messages-in-sap-xi
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • How do I schedule an automator script to run at a certain time every day?

    How do I schedule an automator script to run at a certain time every day?
    This used to be done through iCalendar and this option is no longer available.
    How do I do this?
    --Kenoli

    Kenoli Oleari1 wrote:
    How do I schedule an automator script to run at a certain time every day?
    This used to be done through iCalendar and this option is no longer available.
    How do I do this?
    --Kenoli
    You can use lauchd to run the script.
    Here's an example of an Automator App that I have scheduled to run at 7am daily:
    You would save this as com.yourname.plist and put it the the Folder: ~/Library/LaunchAgents/ (then log out and back in, or reboot)
    (To run a workflow, change open to automator)
    (A nice GUI launchd editor is Lingon)
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Label</key>
              <string>com.tonyt.EventReport</string>
              <key>ProgramArguments</key>
              <array>
                        <string>open</string>
                        <string>/Users/Tony/Library/Scripts/Events Report.app</string>
              </array>
              <key>StartCalendarInterval</key>
              <dict>
                        <key>Hour</key>
                        <integer>7</integer>
                        <key>Minute</key>
                        <integer>0</integer>
              </dict>
    </dict>
    </plist>

  • Run .app at specific time

    How do I get an app I have made in Automator to run at a specific time?
    I want to do something like cron jobs.

    Use Lingon or set an iCal alarm to launch it.
    (41445)

  • To run a scenario exactly once in a specific time every day

    I would like to run a scenario which will read a file in a specific directory and will update the data in the database.
    File -> JDBC
    I would like to run the scenario only once a day in a specified time
    i.e. say 12:00 midnight.
    How can I specify that in the scenario?

    Hi
    Note:You will need to have the authorizations of the user group SAP_XI_ADMINISTRATOR with the role modify.
    Go to Runtime Workbench -> Component Monitoring -> Communication Channel Monitoring
    Locate the link Availability Time Planning on the top right corner of your Communication Channel Monitoring page.
    In your case, the requirement is to schedule the Sender file adapter daily once at 12:00 at midnight.
    In Availability Time Planning, choose the Availability time as daily and say create.
    Provide the details like the time 12:00
    Then select the communication channel , goto the Communication Channels tab and filter and add the respective channel (File Sender).
    Once all the above has been done 'Save' the changes.
    hope it helps
    Thanks

  • Quit an Application at a specific time each day.

    I know how to do something as simple as Quiting an application with AS, but what if I want to run it at say 7pm everyday. Not using iCal.
    Any Ideas?

    You can use the unix-side launchd application to trigger execution of an application at a specific time. In your case you'd want it to launch an AppleScript that tells your other app to quit.
    Programming launchd to do this is easy with an app like Lingon (http://lingon.sourceforge.net/), which provides a gui to set schedules in launchd.
    I use to run two applescripts every 30 seconds and a third one once an hour. Works a treat... and it's free.
    Robert

  • Doing something at a specific time of day

    Hi all,
    Basically what I am doing is an alarm clock, to wake me up to some MP3s. It all works fine.
    My only concern is the following:
         private Thread tTimeCheck = new Thread() {
              public void run () {
                   while (true) {
                       cal = new GregorianCalendar();
                       int hour24 = cal.get(Calendar.HOUR_OF_DAY);
                       int min = cal.get(Calendar.MINUTE);
                       if (hour24 == JSelectHour.getValeur() && min == JSelectMinute.getValeur()) {
                            playMusic = true;
                       } else {
                            playMusic = false;
                       try {
                            t.sleep(1000);
                       } catch (InterruptedException e) {
         };Is it unefficient to check every second, to see if the time of day is equal to the set time on the alarm clock? It seems to me that there has to be a better way to do this.

    Thank you for your reply.
    This is my thread that plays the music.
    while (true) {
       if (playMusic && jpnl.getAlarmStatus() == 1) {
           testPlay("C:/Documents and Settings/Seb/Desktop/Music/01-nirvana-smells.like.teen.spirit.mp3"); //hardcoded for now
    }testPlay is executed the the entire song plays before the next iteration.
    Next step: I'll look to put this in the taskbar (windows tray / whatever it's called), never done that before =)
    Thanks,
    Message was edited by:
    Robocrotch

Maybe you are looking for

  • OKB9 based on Business area and Profit center

    Hi, In Std SAP, we can default cost center based on GSBER or WERKS or PRCTR My req is such that I want a default a cost center based on GSBER and PRCTR i.e. combination of option 2 and 3 in the field "Account account assignment mandatory" Has any one

  • Problem with appletv billing

    When I try to puchase something from AppleTV, it prompts me to enter the CID of a card that I don't use on my usual Apple Account (i.e. purchases for iTunes). How do I change this to reflect the correct Credit Card?

  • Multi-seat Leopard to Lion upgrade... thanks a lot Apple!

    So, if I understand Apple's stance that Lion will only be available through the Mac App Store, and that the Mac App Store is only available on the latest version of Snow Leopard, then my job to upgrade my company's 10 Macs has just become a nightmare

  • Workpace - Web Dynpro Projects vs. DC Projects

    Hello, When creating a DC Project out of the DTR (development track) on the Development configuration perspective, those Projects do not show up on my workspace folder like a regular Web Dynpro projects does. How do I get these DC projects into my wo

  • SCC u2013 Sub contracting with Chargeable components

    we need to use SCC u2013 Sub contracting with Chargeable components. For that, Activated u2018SCCu2019 at Client level and Valuation area level. Any further config process required to use this process? I did not find any difference in postings betwee