Can I write a cron to do this?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Can I write a cron to do this?
# 1  
Old 03-19-2007
Can I write a cron to do this?

OK, I'm new to UNIX so please be patient. I'm wondering if I can set up a cron task on my web server(unix) to control a flash based mp3 player like xspf.

What I would like to accomplish is to have xspf player (on my web site) play one new mp3 every 24hrs. So song one would start at 00:02 and and end at 00:01 after which a new song is loaded from the playlist.

If possible, is this something I would create using cron manager in cpanel or would I have to create a script using something like KDE and have cron manager access the script at a particular time?

I was told that in order to perform this task I would have to create a php script, store info in a database and pass variables to ActionScript which controls the xspf player. Now, although I have some experience with the former, writing this is far beyond my capabilities. The task seems so simple that I figured a cron task could be set up to achieve this.

Any help would be appreciated

Thanks

K
# 2  
Old 03-20-2007
kvk,


I think you can do this but it is not really the correct way to do this. Have your cron job change the mp3 file. In your PHP/Web coding just point to a default mp3 file name and location. Then just have you cron job change the file, but keeping the same name.

Example:

Web page ->

<body><p>This is a link to the music <embed src="http://www.mysite.com/webstation/song.wav" loop="true" autoplay="false" width="145" height="60"></embed> </p>


Cron script ->

#!/bin/sh
#
#

# Getting the hour of the day and use this as a variable
TIME_DAY=`date +%H`

# Force copy the song of the $TIME_DAY to the current song location.
cp - f /webfile/webstation/song${TIME_DAY}.mp3 /webfile/webstation/song.mp3



I hope this helps you. But the correct way would be to use html code or what every you are using to develop your HTML page
# 3  
Old 03-20-2007
Thanks for the reply. Replacing the file was what I was thinking as well. I think maybe I'll make this a long-term project and learn the proper code(php, actionscript) to make this work. I really appreciate the response

Thanks

K
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Add TimeStamp to cron job and write file name sent

Hello, I have written a cron job to automate the sftp of files using key authentication. I wanted to add a timeStamp and name of file sent to a log file and append each these details to the same file each time files are sent and if possible include whether the files were sent successfully or not.... (3 Replies)
Discussion started by: KidKoder
3 Replies

2. Shell Programming and Scripting

Is it possible to write write multiple cronjobs in shellscript??

Hi All, I need the answer of below question? 1) How to write multiple cronjobs in shellscript? Is there any way or we cant write in shellscript... Regards, Priyanka (2 Replies)
Discussion started by: pspriyanka
2 Replies

3. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

4. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

5. Shell Programming and Scripting

How to write cron job for calling sql function database is postgres

Hi, Please help me to write cron job for calling sql function daily. I have Postgres database. (1 Reply)
Discussion started by: kulbhushan
1 Replies

6. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

7. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

8. AIX

AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log

Hi, I can use 'crontabs –e' and do all the scheduling I like. However I would like to auto send myself just the cronjobs logs that fail. That is to say the PIDs that fail and the related lines with those PID’s only. (Not the full set of logs) Has anyone done this work? Or does an AIX 5.3 tool... (0 Replies)
Discussion started by: Keith Johnson
0 Replies

9. Shell Programming and Scripting

Need to write a cron jon(tcsh)....Help me out!!

The question I personally have is will it be possible to design the cron job according to this ‘wish list': 1)Every time cron starts (I mean files are found and processing begins) - email send to a user or to a group of users. 2)The job is divided into 2 separate parts, 2nd jobs starts only... (2 Replies)
Discussion started by: kumarsaravana_s
2 Replies

10. UNIX for Dummies Questions & Answers

Write a cron script

Hi all techie geniuses, I am new to the tehc field and need some help badly. I need a ksh script. Every time a file is dropped in a folder, there should be a script running at all times. What this script does is, simply copies this file in a different folder with timestamps as part of the new... (0 Replies)
Discussion started by: ketanr
0 Replies
Login or Register to Ask a Question