Cron job to start machine.

Is there a way to get the machine to start, open iTunes and start playing a song at a specified time using a cron job?
MacBook Pro 15.4" - Intel Core Duo 2.0   Mac OS X (10.4.6)   2GB RAM

I have my computer do exactly what you want yours to do, except I don't use a cron job. In case you don't actually need to use cron, I'll tell how I get it to happen.
As mentioned by Federico_82, I use the Energy Saver preferences in System Preferences. There is an "Schedule..." button in the lower right corner that will allow you set the startup and/or shutdown times for the computer. It's not very detailed, but it suits my purposes for waking up Monday through Friday.
I also have the computer automatically log me in using the Login Options in Accounts preferences in System Preferences.
Finally, I've set alarms in iCal and chose "Open file" in the alarm section of the Info drawer. You can select a song file (or anything really) to be opened and the song will be played with iTunes since songs should automatically open with iTunes.
I've also set the final option in the alarm section to perform this 5 minutes before the time I set for the event, with the event time being the same time as the computer startup. This is okay because it will perform an alarm that was suppose to happen even if it couldn't do it earlier, for example because the computer was off. So you don't have to worry about timing it perfectly. Just set the alarm time to the same as the startup time for the computer or earlier if you want it to happen immediately upon startup, then the alarm will go off immediately after computer turns on and logs you in.
Also keep in mind you can set the event to repeat at various intervals in iCal, such as Monday through Friday or various discontinuous days of the week every week, and so on. Very customizable.
Personally, I use an Automator app to start playing a playlist in iTunes, and to set the iTunes volume to an appropriate level to wake up with just in case I've change the volume the last time I used iTunes. In this way, I can simply change the song in the playlist in iTunes without having change the alarm event in iCal. This helps because then I can copy/paste the alarm anywhere I want and don't have to worry about finding another song file if I want to change the song. Instead, I simply find the song I want in iTunes and put it in the playlist, along with any other songs I want have played.
If you do it with an Automator workflow, simply save the workflow as an iCal Alarm with "Save As Plug-in...". It'll automatically save in your ~/Library/Workflows/Applications/iCal folder, without you having to figure that out. Oh, and it doesn't hurt to test the workflow to make sure it plays your playlist (or whatever you have it do) before saving it as an iCal Alarm. Though, you can re-edit later if you want.
Once you've saved your workflow as an iCal Alarm, it'll show up in list of files to open in the alarm section for the event. So, after you've chosen "Open file" in that section, the default for the file will be "iCal", but you'll also be able to choose any iCal alarms you've saved in Automator or any other file (such as a document or a song).
Just as a bit of trivia, a plug-in you save in Automator is actually the same thing as saving your workflow as an application. The only difference is that the app is saved to a specific location so the Finder, or iCal, or Image Capture, etc., can find it. So, you don't have to know where to save it, Automator does that for you, but I told you where it is anyways (though you could use Spotlight) so you can get to it to edit it again if you want. Just drag and drop the app onto Automator or open it from within Automator to edit it again.
I hope that helps. Though it might sound kind of complicated at first, I think this way is much easier than dealing with a crontab and trying to synchronize it with startup and so on. You'll also find this way very customizable with the various options for iCal alarms and the many possibilities with Automator (if you choose to use a workflow instead of simply a song file).

Similar Messages

  • Cron Job to start SunOne WebServer

    Hello,
    I installed the SunOne Webserver in Linux AS 4 as OS level. I try to create a cron job to stop and start the WebSever every night. The stop is quite simple to create a cron job. However, the start script is a bit tricky since I will have to key in the Token (password) as I manual start the script. How do I create a cron job to start the Web Server like this?
    I used the Web server to do datatel's webadvisor. I just don't know how to configure the SunOne Web Server 6.1 (SP5) to the best interface with webadvisor. Does any one have this kind of experience please share with me?
    Your thought would be greatly appreciated!!!!

    mle wrote:
    Hello,
    I installed the SunOne Webserver in Linux AS 4 as OS level. I try to create a cron job to stop and start the WebSever every night. Why on earth would you want to do that? This is Linux, not Windows.
    My guess is that you have memory leaks that benefit from a bounce to set the clock back to zero on a daily basis.
    My advice would be to fix the leaks and don't bounce the server that way.
    If the leaks originate with the app server, get one that doesn't leak.
    Does any one have this kind of experience please share with me?Sounds like a very bad idea. I'd fix the root problem first.
    %

  • [SOLVED] Cron Job that starts every 30 minutes from boot

    I wish to have a cron job that runs a script every 30 minutes from boot, without any users logging in.
    I know about crontab -e, but I think that would I only run once i'm logged in. I've also heard about @reboot, but that would only run the script once.
    RabbidRabbit
    Last edited by rabbidrabbit (2012-01-31 20:14:13)

    Cron jobs will run whenever the system is up, regardless of whether or not anyone is logged in.
    I don't remember the syntax, but I know that at least some cron implementations have a way to run a job every 30 minutes, starting for the first time 30 minutes after reboot.
    EDIT: I just checked the syntax for fcron, which is what I use, and it seems like doing @ 30 your/command/here will make it run every 30 minutes of uptime.
    Last edited by kyla (2012-01-31 00:17:30)

  • Starting stoping cron job

    How we can tell which cron jobs are running and how to start/stop them, give me example/command plz

    I do not know of any articles off the top of my head, but just remember if you can create a non-interactive script to do the job then you can run it as a cron job.
    Here are several types of cron jobs that we currently use:
    1. Kick off nightly hot and weekly cold backups.
    2. Gather statistics weekly (on just some databases)
    3. Gather performance statistics (perfstat) when wanted.
    4. Perform audit gathering/deletion jobs.
    5. Check for errors in alert logs and trace files and send out emails if needed.
    6. Check status of listeners and database processes to assure they are still running.
    7. Move log files to archiving storage
    We are going to eventually move a lot of these jobs to OEM Grid Control but until then cron is great.
    Regards
    Tim

  • Should I use the built in log rolling function on iWS 6 or roll my own using a cron job using stop and start scripts in the web server instance root?

     

    Hi,
    You can use either OS cron job based log rotation
    OR
    Internal daemon log rotation.
    It is recommeded to use OS cron job log rotation.
    OS=Operating System
    Regards,
    Dakshin.
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support.

  • Cron Job in Root Directory

    I am running OS 10.4.6 on a Mac G4 450MHz machine. Recently when I opened Activity Monitor I noticed a cron job showed up in the root directory that hadn't been there before. I know I can select the cron job and then click on the Inspect icon but the dialogue boxes that show up do not tell me anything about the cron job except statistics having to do with CPU or memory usage. How do I find out what the cron job is and what it does? Is having a cron job in the root directory normal for 10.4.6? If it's not supposed to be there, how do I get rid of it?
    Thanks for your help.
    G4   Mac OS X (10.4.6)   450MHz with 768MB of RAM

    David,
    I think you are seeing the cron daemon. Not a "cron job". The cron daemon is started during the boot process. Cron then reads /etc/crontab. Crontab list "jobs" to be run and at what time. As of Tiger cron has been demoted and launchd handles running "jobs". Cron is still started at boot time but does nothing. It runs for backwards compatibility. There's nothing to get rid of- just leave it alone.

  • Cron job is not working SCP automated shell script

    #!/usr/bin/expect -f
    # connect via scp
    spawn scp "[email protected]:/u04/dumps/test.dmp" /u10/app/
    expect {
    -re ".*es.*o.*" {
    exp_send "yes\r"
    exp_continue
    -re ".*sword.*" {
    exp_send "pwd\r"
    interact
    above is the automated script to download the file from remote server to local server.
    I am trying to download around 2GB file. for that i am using the above automated script. But that script is not working cron service.
    Cron is not executing that script to download the file from Remote server to Local Server.

    Cron is not executing that script to download the file from Remote server to Local Server.That script only or any script ? Did you try with something else ?
    I had a similar problem on a Linux machine, where cron jobs didn't start, and the only solution was to restart cron daemon whenever crontab files were updated.

  • How to take the cron job log in HP UX?

    Hi,
    How to take the cron job log in HP UX
    I need to run a backup and other stuff everyday. How do I check and start cron service under HP-UX UNIX operating system? How do I write cron jobs?
    A. Cron service is required to run jobs and tasks such as backup.
    You must login as the root to run following commands. Each user that is using the cron service must have a cron configuration file in the /var/spool/cron/crontab directory. Also users are permitted if their name appeared in /var/adm/cron/cron.allow file
    Task: Find out if cron is running under HP-UX
    Type the following command at a shell prompt
    # ps -ef | grep cron
    Open /etc/rc.config.d/cron file
    vi /etc/rc.config.d/cron
    Set control variable to 1 to enable cron: CRON=1
    Set control variable to 0 to disable: CRON=0
    Close and save the file. To start or stop cron you can type the following command:
    # /sbin/init.d/cron start <-- start cron
    # /sbin/init.d/cron stop <-- stop cron
    Task: HP-UX Start cron service
    If cron is not running, simply type:
    # cron
    Task: Edit / create cron jobs
    Type the following command to submit a cron job:
    # crontab -e
    List your cron file:
    # crontab -l
    Backup all your cron jobs:
    # crontab -l > ~/backup.cron.jobs
    Remove ALL cron job:
    # crontab -r
    Task: Crontab file format
    Cron file format is as follows:
    MIN HOUR DATE MONTH DAY /PATH/TO/COMMAND
    0-59 0-23 1-31 1-12 0-6 /root/scripts/backup2tape.shEasy to remember crontab file format:
    * * * * * command to be executed
    | | | | |
    | | | | ----- Day of week (0 - 7) (Sunday=0 or 7)
    | | | ------- Month (1 - 12)
    | | --------- Day of month (1 - 31)
    | ----------- Hour (0 - 23)
    ------------- Minute (0 - 59)To run /root/script/backup at 23:00, every day, enter:
    # crontab -e
    Append following
    0 23 * * * /root/script/backupRun foo job very weekday (MON-Fri) at 6am, enter:
    0 6 * * 1-5 /root/script/backupFor more information refer to cron and crontab man pages.
    Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.
    Related Other Helpful FAQs:
    What is Cron?
    Linux Start and stop the cron or crond service
    Run crontab Every 10 Minutes
    Linux / UNIX Setup and run php script as a cron job
    Stop Ubuntu / Debian Linux From Deleting /tmp Files on Boot
    Discussion on This FAQDavid Says:
    January 15th, 2008 at 12:21 am
    You might note that all files normally found in /etc/init.d, /etc/rc*.d, and others are all in /sbin in HP-UX 10.20 and up.
    Note too that your formatting is off in the description of the /etc/rc.config.d/cron file. Also, if you run /usr/bin/cron instead of /sbin/init.d/cron start, the /etc/rc.config.d/cron file is not used.
    Regards,
    Satya

    I guess it would :)
    btw, how did this piece miss from the contents pasted by the OP ?
    The doc has given all details of CRON and missed where to see the logfiles. :)
    ****Added****
    I tried man crontab in windows, i dont see it.i overlook most of the things, i would have done the same ;)
    Edited by: Bobcatalog on Oct 23, 2008 9:40 AM

  • How to Create Linux-Cron Job  from a Java Program

    Hello,
    Can anybody help me to CREATE/EDIT/DELETE Linux Cron job from Java Program. Its Very Urgent.Thanks in advance..
    from
    Chakri

    I decided this didn't sound too tough so I played around with it a little. Basically because I'd never tried executing external processes out of java before, so I wanted to see how it was done.
    Just change whatever you like in the jobs ArrayList and call writeJobs.
    If you call writeJobs without putting anything in the list first you'll wipe out all of your crontab entries.
    import java.lang.*;
    import java.io.*;
    import java.util.*;
    public class cron {
        ArrayList jobs;
        Runtime rt;
        cron() {
         rt = Runtime.getRuntime();
         jobs = new ArrayList();
        void readCron() {
         String[] list = { "crontab", "-l" };
         jobs = new ArrayList();
         try {
             // Stick a job into crontab
             Process child = rt.exec(list);
             BufferedReader cronout = new BufferedReader(new InputStreamReader(child.getInputStream()));
             String cronjob = cronout.readLine();
             while (cronjob != null) {
              jobs.add(cronjob);
              cronjob = cronout.readLine();
             child.waitFor();
         catch(IOException e) {
             System.err.println("IOException starting process!");
         catch(InterruptedException e) {
             System.err.println("Interrupted waiting for process!");
        void listJobs() {
         Iterator iter = jobs.iterator();
         while (iter.hasNext()) {
             System.out.println((String)iter.next());
        void writeJobs() {
         String[] edit = { "crontab"};
         try {
             // Stick a job into crontab
             Process child = rt.exec(edit);
             PrintWriter cronIn = new PrintWriter(child.getOutputStream());
             Iterator iter = jobs.iterator();
             while (iter.hasNext()) {
              cronIn.println((String)iter.next());
             cronIn.close();
             child.waitFor();
         catch(IOException e) {
             System.err.println("IOException starting process!");
         catch(InterruptedException e) {
             System.err.println("Interrupted waiting for process!");
        void doStuff() {
         readCron();
         listJobs();
         jobs.add("* * * * 4 cronjob");
         writeJobs();
         readCron();
         listJobs();
        public static void main(String[] args) {
         cron c = new cron();
         c.doStuff();
    }

  • EJB Persistence using cron job

    We have a EJB based bean managed persistence classes that run on the app server. I want to use same classes using cron job.
    How do I do that???
    Tried to execute these classes thru following steps...
    In side stand alone java class - main method create instance of the pmf and get persistence manager.
    Start a tread and call JDO object using persistence manager.
    getting whole bunch or errors like system-server-config.xml file not found. I am not able to create InitialContext outside app server.
    Please give your suggestions. TIA

    Why don't you use a J2EE based scheduler?
    http://java-source.net/open-source/job-schedulers/quartz
    http://java-source.net/open-source/job-schedulers/jcrontab

  • UNIX Command to run cron jobs

    Is there a UNIX command I can send to the target machines to force them to run the 'Daily, Weekly, & Monthly' cron jobs?
    Do you guys know of a place that I can find useful commands to send to the machines?

    Send:
    periodic weekly
    This command will run, right now, all the system maintenance commands which normally run via cron only at 4:30 on Saturday morning. To see the actual maintenance commands that are going to be executed, look in /etc/periodic/weekly. You can also do "periodic daily" or "periodic monthly".

  • Cron job help

    hya m8s!
    so i want to create a cron job that will do the following in order.
    1.  run pacman -Syu
    2.  run pacman -Scc
    3.  run lilo (incase of kernel upgrade)
    i want this to run every day at 5am,
    the problem is that i know what i want it to do i just have NO idea how to implement it.  i have researched cron jobs a bit but i havent found an easy to understand way exec the above commands.  one of my m8s suggested i use the "at" command but i dont think i can set that to run at a specified time every day.  Please help if you can.
    cheers,
      cdk
    (note: once ifigure out cron i want to start to try to figure out how to build packages. i have also read the wiki on this and still dont get it)

    cdk wrote:
    why is it a bad thing to do?  seems like it would be a good thing so it keeps the system up to date right?
    i figure that if i do it manually or not i still doing the same thing everyday.  any info as to why this would be bad would be great.  i def dont want to mess up my system.
    Take KDE 3.3 to KDE 3.4 upgrade as an example:
    Your way would have just updated KDE without considering possible side-effects. The recommended way in this case was removal prior to upgrade.
    You would not have been able to follow those recommendations if a script would have done the job.
    If you really feel the need to auto-upgrade everyday, I'd recommend excluding problematic packages (e.g. kernel. IMO that should only be upgraded with the user watching) and keeping that list up to date by checking with the ARCH news and boards...
    greez
    bernhard

  • Cron job emCCR after installed OBI11.1.1.5.0

    OBIEE 11.1.1.5.0 on Rdhat 5.2. After installation saw a cron job created0,15,30,45 * * * * ORACLE_CONFIG_HOME=/u01/app/obi11115/instances/obi11_dev /u01/app/obi11115/Oracle_BI1/ccr/bin/emCCR -cron -silent start emCCR appears to be Configuration Manager. But do I have a Configuration Manager running for a default installation of OBI 11.1.1.5.0 Enterprise? If not does it has impact on my OBIE11
    Thanks

    A restart solved the issue.

  • What is "nmz" on cron job?

    after we installed VIS demo database (R12), I found rapidinstall put one entry on cron job. Look like this job relate to concurrent manager.
    0,15,30,45 * * * * JAVA_HOME=/u4/oracle/VIS/db/tech_st/10.2.0/jdk /u4/oracle/VIS/db/tech_st/10.2.0/ccr/bin/emCCR -silent start
    anyone can tell me what is this process really doing?
    Can I stop it?
    if I remove entry from cron job, what going happen?
    Thanks.

    According to Oracle MetaLink Doc ID 781925.1, the cron job belongs to the Oracle Configuration Manager (OCM) Collector. OCM is said to be packaged with all Oracle software distributions, including Critical Patch Updates, patch sets and product releases.
    OCM documentation is available from Oracle at:
    http://www.oracle.com/technology/documentation/ocm.html

  • A simple question?-how can I find out a cron job finishing time?

    Hi, everyone:
    I have a cron job for export, I know it starting time, how could I find its finishing time? anyway, I have check the log, but no answer.

    at the end of the script append the end date and time to the log file.
    echo "JOB COMPLETED AT `date`" >> x.log
    $more x.log
    JOB COMPLETED AT Mon Jan 22 16:04:16 EST 2007
    As your job is an export, export dump timestamp would give you the end time. Do ls -ltr on the dump file, the date time should be the completed time of the export.
    $ls -ltr exp_test.dmp
    -rw-r--r-- 1 oracle dba 2048 Sep 11 14:19 exp_test.dmp
    Message was edited by:
    Ranga
    Message was edited by:
    Ranga

Maybe you are looking for

  • Battery Life LG Revolution

    This may not be a 4G issue at all but I've read alot about 4G being the ax murderer of batteries so I thought I would start here: I'm trying to find any other tips to get more battery life out of my new phone. I went from 24 hours of standby time on

  • Multiple VPNs on one interface troubles

    Hello. I am still pretty new to Cisco IOS, but I think I'm getting there. Right now I am trying to configure a sort of mesh VPN setup between five routers in such a way that every router can conect to every other roughter through VPN over an emulated

  • ITunes 11 Edited Tags Changing/Reverting

    Hello, I have an iTunes collection that has been building since 2006. I divide my music into a few categories using the "grouping" tag. Often times when I edit the "grouping" tag I am overwriting either the label or a web address which had been previ

  • Sendmail + IMAP on Solaris 11

    I need to enable IMAP to be able to connect remotely (from within the same network but a different computer) to my local Sendmail mailboxes on my Solaris 11 server. I haven't found any articles about that for Solaris 11, but I have found one for Sola

  • How to shorten my clip

    I have a video thats only 7 minutes long but the overrall duration is 42 minutes...How do I shorten the video? I just want it to be 7 mins..