LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Quick cron question.... HHHHEEEEELLLLPPPP!!! (https://www.linuxquestions.org/questions/linux-software-2/quick-cron-question-hhhheeeeellllpppp-203815/)

perry 07-11-2004 04:30 PM

Quick cron question.... HHHHEEEEELLLLPPPP!!!
 
here's my /etc/crontab

Code:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jre/bin:
MAILTO=root
HOME=/

# run-parts
01 * * * * root nice -n 19 run-parts /etc/cron.hourly
02 4 * * * root nice -n 19 run-parts /etc/cron.daily
22 4 * * 0 root nice -n 19 run-parts /etc/cron.weekly
42 4 1 * * root nice -n 19 run-parts /etc/cron.monthly

here's my /etc/spool/cron/perry

Code:

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.3376 installed on Sun Jul 11 17:18:01 2004)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
*/1 * * * * nice -n 19 run-parts /home/perry/cron

here's the contents of /home/perry/cron

Code:

chgimage
chgimage.jar

here's the contents of chgimage

Code:

#!/bin/sh
cp /mnt/maxtor/Network/nice/nice01/satellite_image.jpg /mnt/maxtor/Network/nice/nice01/image.jpg
java -jar chgimage.jar /mnt/maxtor/Network/nice/nice01 /home/perry/cron/chgimage

it's a cool idea, to have a java program run every minute, pick an image and write it out where gkrellm-kam can read it, then re-write the chgimage script itself so that next time there's a new update....

so close yet so far away, everything works but the damn cron....

and i wonder if run-parts has a big problem with the jar file, i guess i can try and move that out of the way....

any lesson in the blatent obvious would be greatly appreciated...

- perry

perry 07-11-2004 04:36 PM

i suppose the writing of the script file while one process might be reading it could be a problem, but you would think that it would have to be completely read before that becomes a problem....

in any event, i suspect i just cannot figure out how to specify a cron job to run every minute....

- perry

perry 07-11-2004 04:47 PM

this fellow said to something i thought for sure made sense origionally, but i'm not seeing any action:

Quote:

un 'crontab -e' and see what happens. In Linux you'd get a text editor to add cronjobs with, but if OSX works differently then I can't help you.

Your cron job would look like this:
Code:

* * * * * ping 255.255.255.255
That would run it every minute as long as your computer is turned on. I don't think you can run it every 10 seconds with the usual cron, but maybe an alternative cron will be able to.
_________________
shakin
- perry

perry 07-11-2004 05:00 PM

i put a test script in the cron folder to make sure cron was working, then i resolved it's targetting parameters

aka:

Code:

HOME=/home/perry/cron
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jre/bin:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.3376 installed on Sun Jul 11 17:18:01 2004)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
* * * * * nice -n 19 run-parts /home/perry/cron

seems to work, really really nice....!

- perry


All times are GMT -5. The time now is 03:33 AM.