image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old May 12th, 2002, 04:49 AM
Registered User
 
Join Date: Jul 2001
Location: FL
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
iknownotwhoiam is on a distinguished road
cron alarm clock

i have my crontab set up to wake me up every morning by playing a song in iTunes. the only problem is i have to manually set which song i want it to play every night. is there any way that i can get cron to randomly pick a file to play from a list i have generated, such as read a file and pick one? if so, could someone please fill me in on how to do this. thanks.
Reply With Quote
  #2  
Old May 12th, 2002, 07:51 AM
hydo's Avatar
Registered User
 
Join Date: May 2002
Location: Portland, OR
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
hydo is on a distinguished road
Get thee to here: http://www.versiontracker.com/morein...d=13824&db=mac
Reply With Quote
  #3  
Old May 12th, 2002, 11:46 AM
Registered User
 
Join Date: Oct 2001
Location: US
Posts: 689
Thanks: 0
Thanked 0 Times in 0 Posts
lethe is on a distinguished road
what do you have in crontab? open song.mp3?

why don t you create a small applescript file that launches iTunes and starts playing at random, and put 'open applescript' in crontab
Reply With Quote
  #4  
Old May 12th, 2002, 05:06 PM
scruffy's Avatar
Notorious Olive Counter
 
Join Date: Dec 2000
Location: Soviet Canuckistan
Posts: 1,726
Thanks: 0
Thanked 0 Times in 0 Posts
scruffy is on a distinguished road
also check versiontracker for "MP3 Alarm Clock". Nice little app, featureful and free.
__________________

What is the robbing of a bank compared to the founding of a bank?
-- Bertold Brecht
Reply With Quote
  #5  
Old May 12th, 2002, 11:50 PM
blb blb is offline
`'
 
Join Date: Apr 2001
Location: CO, USA
Posts: 651
Thanks: 0
Thanked 0 Times in 0 Posts
blb is on a distinguished road
Or one line:
Code:
perl -e 'print "$ARGV[ int rand( scalar( @ARGV ) ) ]\n";' /path/to/mp3/*
Reply With Quote
  #6  
Old May 14th, 2002, 11:45 PM
Koelling's Avatar
I Think Different
 
Join Date: Oct 2001
Location: Colorado
Posts: 602
Thanks: 0
Thanked 0 Times in 0 Posts
Koelling is on a distinguished road
I'm confused, can some one help me out?

Where does this code stuff go? I know the CLI fairly well but I don't know scripts very well. obviously I can't just enter "perl -e 'print "$ARGV[ int rand( scalar( @ARGV ) ) ]\n";' /path/to/mp3/*" into cronnix so how do I make it work? Sorry if this is overly easy but the thread kinda jumped in above my head.
__________________
1 ghz pb w/ 768M RAM, 10.3.latest (usually). Yeah life is good.
Reply With Quote
  #7  
Old May 15th, 2002, 12:54 AM
Registered User
 
Join Date: Mar 2002
Location: Denver
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
BSDimwit is on a distinguished road
it goes in your...

crontab file...

type crontab -e (this will open you crontab file for editing)

then, depending on what time you want it to go off, you set the time like so

0 7 * * * /Users/yourname/scriptsdir/alarm.pl

Basically, you all the other stuff the other guys told you, would go into a script called alarm.pl, and the cron daemon will run it at 7am or whatever time you set it for. For more info on crontab do a man crontab... with that you should be able to figure out how to start stuff up at designated times.

Hope this answers your question.
__________________
BSDimwit
Titanium Powerbook 550
512MB ram
Reply With Quote
  #8  
Old May 16th, 2002, 03:10 PM
Koelling's Avatar
I Think Different
 
Join Date: Oct 2001
Location: Colorado
Posts: 602
Thanks: 0
Thanked 0 Times in 0 Posts
Koelling is on a distinguished road
Thanks I have used it just crontab -e before but I'm not entirely proficient in it so I use cronnix which does the same job, just cocoaized. And that part about alarm.pl is exactly what I wanted to know.
__________________
1 ghz pb w/ 768M RAM, 10.3.latest (usually). Yeah life is good.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[HOWTO] - Make iCal an alarm clock! boi HOWTO & FAQs 16 May 28th, 2005 01:53 PM
[HOWTO] - Use iTunes as an alarm clock tieng HOWTO & FAQs 17 January 21st, 2004 09:52 AM
cron alarm clock iknownotwhoiam Mac OS X System & Mac Software 1 May 12th, 2002 08:52 AM
menu bar clock / classic clock overlap xegan Mac OS X System & Mac Software 4 January 13th, 2002 09:46 PM
menu bar clock / classic clock overlap xegan Mac OS X System & Mac Software 0 January 9th, 2002 09:31 PM


All times are GMT -5. The time now is 05:11 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.