Computing.Net > Forums > Linux > cron chime on the hour

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

cron chime on the hour

Reply to Message Icon

Name: beany
Date: February 25, 2007 at 22:48:36 Pacific
OS: damnsmalllinux2.4
CPU/Ram: p166/48meg/swap
Comment:

I am wanting to add an hourly chime to damnsmall
I installed sox.dsl and cron30.dsl
I have a chime.au file

I added to /opt/bootlocal.sh...sudo /etc/init.d/cron/start

I added to /home/dsl/filetool1st...etc/crontab

I type in console..play /home/dsl/chime.au
the chime sounds

I first opened the /etc/crontab file and added
0 * * * * play /home/dsl/chime.au

this did not work

second I opened beaver and typed the same line and saved the file to /home/dsl and called it chimeron

I then opened a console window and typed crontab /home/dsl/chimeron

this created a dsl file in var/spool/cron/crontabs/dsl
when I open the dsl file it shows the line and can be altered via the same process

this did not work

can anyone help me



Sponsored Link
Ads by Google

Response Number 1
Name: wollie
Date: February 27, 2007 at 05:10:23 Pacific
Reply:

beany,

it might help to provide the full qualified pathname to command "play" (in the crontab entry)

cheers
wollie


0

Response Number 2
Name: beany
Date: February 27, 2007 at 15:04:53 Pacific
Reply:

Thanks
I replaced the var/spool/cron/crontabs/dsl file with a new one with the line
0-59 * * * * /usr/bin/play /home/dsl/chime.au

thinking it may chime every minute as test

but it will still not chime

try also removed the space- /play/home/

the filetool1st entry is etc/crontab

I did not make change to the /etc/crontab
but did not think I had to and did not know how to replace it with the new one if I did

when I boot it lists cron as starting

any other thoughts

I really really want this to happen
thanks for any


0

Response Number 3
Name: ernie
Date: February 27, 2007 at 19:23:39 Pacific
Reply:

I use Mandriva Linux here, and I have a directory:

/etc/cron.hourly

Any executable script I put in this directory is executed each hour.

You can create a script named perhaps chime.sh (because it will sound a chime):

-------------------------
#! .bin/sh

# sound a chime
play /home/dsl/chime.au
end
-------------------------

As root, save this file as:

/etc/cron.hourly/chime.sh

then make it executable:

chmod +x /etc/cron.hourly/chime.sh

If you do not have this directory (/etc/cron.hourly), as root, save the script as:

/usr/local/bin/chime.sh

make it executable:

chmod +x /usr/local/bin/chime.sh

and set up a cron job:

* 0-24 * * * /usr/local/bin/chime.sh

HTH,

Ernie Registered Linux User 247790
ICQ 41060744


0

Response Number 4
Name: beany
Date: February 27, 2007 at 20:19:45 Pacific
Reply:

Thankyou
I would like to try this as I have a dir /etc/cron.hourly
the info file for cron.dsl said that I may opt to put executables in there as long as I change the filetool entry to /etc/cron.hourly I assume this means the /home/dsl/.filetoo1st file as I put the /etc/crontab entry there

however I am unclear on the creation and how to delete if it does not work

in a console I could not get a editer to open so I used beaver to save a file and then in a console typed crontab file to get the var/spool/cron entry this can be removed with crontab -r

can I type the script in beaver and save.. then type in a console window as root
$ save /location/file /etc/cron.hourly/file.sh

then proceed as mentioned? to make executable

how do I delete this if it does not work safely

sorry...I am new to all this and need baby talk..it is a simple function but required to make the system useful for me
I do not want to mess up what I have managed after MANY hours to create
many thanks for what you offered and many more for any additional assistance


0

Response Number 5
Name: beany
Date: February 27, 2007 at 21:31:04 Pacific
Reply:

well..I could not help jumping in head first

I typed the script in beaver

#! .bin/sh

#sound a chime

play /home/dsl/working/zsnd/chime.au
end

(this directory /working/zsnd/chime.au is for safe storage of the chime.au so it will not be lost amoung home and working files)


and saved as chime.sh
and suprise it saved as chime.sh

I opened emlfm as a superuser and copied the file to /etc/cron.hourly

in the root box below I typed chmod +x /etc/cron.hourly.sh

this changed the color of the file green that indicates it is executable

I changed the filetool1st entry to etc/cron.hourly

there was no chime on the hour : (

when I right click the chime.sh in cron.hourly and execute...I get the following error

sh: ./chime.sh: .bin/sh: bad interpreter: no such file or directory

I rebooted

is there a repair
can I delete at will

does the /etc/crontab play any part?
it has default entries for daily, monthly, weekly but no hourly and I do not have a var/cron/log
thanks for any


0

Related Posts

See More



Response Number 6
Name: beany
Date: February 27, 2007 at 21:58:09 Pacific
Reply:

note to self...wait to post

I was inspired to read some scripting info and replaced #! .bin/sh with /bin/bash

the file will now execute without error

I await the top of the hour.


0

Response Number 7
Name: beany
Date: February 27, 2007 at 22:20:51 Pacific
Reply:

well..going to /etc/cron.hourly I can execute the script but

did not play on the hour

three days

i'm going to cry


0

Response Number 8
Name: beany
Date: February 28, 2007 at 14:24:13 Pacific
Reply:

Thanks folks so much for the bits

thanks, yes, If you use the crontab you need to use the complete path to play

0 * * * * /usr/bin/play /home/dsl/chime.au

also I moved the executable script chime.sh to /usr/local/bin/chime.sh

what was missing I discovered after going to cry was

ROOT

In both cases this is nessessary

0-59/1 * * * * root /usr/bin/play /home/dsl/chime.au
after reboot this plays chime every minute

changed to

0-59/1 * * * * root /usr/local/bin/chime.sh
will play chime every minute

I like the chime.sh as the hourly as I can edit and change the sound to another and save and it plays the new sound on the hour ,,thanks for the code...and inspiration to other scripts

I can use the other for additional reminders like whistleing on trashday or well I'm going to play

DONE..kinda

Thanks so much for the assistance I am so very happy


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: cron chime on the hour

I have linux in one partition. How do I install WIN98 on the other? www.computing.net/answers/linux/i-have-linux-in-one-partition-how-do-i-install-win98-on-the-other/122.html

How do I get a linux box on the net thru a windows box? www.computing.net/answers/linux/how-do-i-get-a-linux-box-on-the-net-thru-a-windows-box/1961.html

Install Linux on the same H/D as Win 98 www.computing.net/answers/linux/install-linux-on-the-same-hd-as-win-98/11113.html