|
|
#1 |
|
Guest
Posts: n/a
|
Basically I have an application I want to be able to start every day at 3am and stop it every day at 6am. It is a file transfer program and my network connection removes download limits during this timeframe. Anyway, I am sure some guru out there can tell me an easy way to accomplish this task so...
I have an iMac running OS X 10.4.11 Thanks in advance. |
|
|
|
#2 |
|
League Commissioner
Join Date: Jan 2005
Posts: 8,475
|
Is it Applescriptable? You could set iCal to run an Applescript to open it and do your downloads, then another to close it. That's the easiest way I know.
You could use launchd to launch a shell to do the same thing, but that requires some comfort with the Terminal. |
|
|
|
|
|
#3 |
|
MVP
Join Date: Jan 2007
Posts: 1,751
|
I wonder whether QuitApp++ (which also appears to be able to launch apps according to its online help page) might do the job?
http://mactips-lib.net/m/software/qa/en/main.html http://mactips-lib.net/m/software/qa/en/help.html |
|
|
|
|
|
#4 |
|
League Commissioner
Join Date: Sep 2003
Location: Tokyo
Posts: 6,045
|
Unattended processes are perfect for the terminal, but terminal stuff often doesn't mix well with the Desktop applications. Are you simply trying to upload/download a folder full of files? Very easy to do from the command line, but a few more details are needed from you.
|
|
|
|
|
|
#5 |
|
Registered User
Join Date: Dec 2007
Posts: 2
|
This may not be what you need, but Carbon Copy Cloner is free and can be set up to back up part or all your files at any time you choose. Turns itself off, too.
|
|
|
|
|
|
#6 |
|
League Commissioner
Join Date: Sep 2003
Location: Tokyo
Posts: 6,045
|
CCC is a backup program, it doesn't do file transfers to other machines.
CCC is also just a GUI wrapper for some terminal commands, scripting it to run at certain times is really doing things the roundabout way. |
|
|
|
|
|
#7 |
|
Hall of Famer
Join Date: Sep 2004
Location: Springfield, MO, USA
Posts: 3,110
|
It's kind of a simpletons way of doing things. But if I want to do that I just set up the program to open at login, then I tell the computer to wake up at 3am and close at 6am. It's under energy saver under system prefs. I used to use it as a makeshift alarm clock as well...
__________________
~ Long ago I was called Zalister, keep that in mind when reading responses to my old posts. |
|
|
|
|
|
#8 |
|
Registered User
Join Date: Sep 2008
Posts: 1
|
I was having the same issue and after a visit to the Mac Genius's no luck.
However today i found a program called "Timer" which appears to atleast start the program - no closing it down though. http://www.apimac.com/index.php Hope it helps. |
|
|
|
|
|
#9 |
|
Hall of Famer
Join Date: Apr 2007
Posts: 4,262
|
use launchd. you can either do it with two plists, or with one plist and a script. the plist to launch the app looks like this:
Code:
<?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>my.openit</string> <key>ProgramArguments</key> <array> <string>open</string> <string>-g</string> <string>posix path to application package file...</string> </array> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>15</integer> <key>Minute</key> <integer>0</integer> </dict> </dict> </plist> Code:
<?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>my.closeit</string> <key>ProgramArguments</key> <array> <string>killall</string> <string>appname...</string> </array> <key>QueueDirectories</key> <array/> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>18</integer> <key>Minute</key> <integer>0</integer> </dict> <key>WatchPaths</key> <array/> </dict> </plist> you might want to shave 5 minutes off the 18 for close it - if your computer is working hard, launchd might not set this off exactly at the StartCalendarInterval time.
__________________
Philosophy is a battle against the bewitchment of our intelligence by means of language. -LW- |
|
|
|
|
|
#10 |
|
Registered User
Join Date: Apr 2009
Posts: 1
|
Ok, a very old thread, but I think my information can still help some.
Mac OSX is a BSD unix variant. It's got crontab to schedule processes. #on the command line, either with the Terminal utility, or X11 (if you've installed it.) Code:
set EDITOR vi Code:
set EDITOR emacs Code:
set EDITOR Your_Favorite_Plain_Text_Editor Code:
crontab -e Code:
# Enter the text following this comment.
# The '#' at the beginning of each line designates a comment in the crontab
# start your program at 3 am everyday
0 3 * * * /path/to/your/program
# at 6 am, search for the program and kill the process
0 6 * * * "ps -auxw| grep program |awk '{print $2}'|xargs kill"
If you want to test out something simple, set your crontab to start up something simple. It's best to set the time for 5 minutes after the current time. You need at least 2 minutes. The crontab process may not restart fast enough to load the new times if you set it under a minute. Here's some examples: Code:
# Start your terminal at 11:47 am
47 11 * * * /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal
# at 11:50 am, search for the program and kill the process
50 11 * * * "ps -auxw| grep Terminal |awk '{print $2}'|xargs kill"
Code:
# If you have X11 installed, start X11 at 11:45 am
45 11 * * * /Applications/Utilities/X11.app/Contents/MacOS/X11
# at 11:50 am, search for the program and kill the process
50 11 * * * "ps -auxw| grep X11 |awk '{print $2}'|xargs kill"
Code:
# Start Safari at 1:59 pm
59 13 * * * /Applications/Safari.app/Contents/MacOS/Safari
# at 2:10 pm, search for the program and kill the process
10 14 * * * "ps -auxw| grep Safari |awk '{print $2}'|xargs kill"
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|