Linked by Jussi Pakkanen on Tue 17th Apr 2007 18:20 UTC
Editorial Let me begin by telling you a little story. Some time ago I needed to run a script at work once a day. We had tons of machines ranging from big Unix servers to Linux desktops. Due to various reasons the script could only be run on a desktop machine. However using cron was disabled on desktops. All other machines allowed cron.
Permalink for comment 231709
To read all comments associated with this story, please click here.
A rebelious approach
by blixel on Tue 17th Apr 2007 21:40 UTC
blixel
Member since:
2005-07-06

Write a shell script that does what you want but uses so much CPU time they will gladly give you cron job access just to get you to quit using the "work around".

#!/bin/sh
while true ; do
if [ "$(date +%k:%M)" = "05:00" ] ; then
do_something_important ;
fi ;
done ;

Note: The functional part of that script will run for the entire minute of 5:00 a.m. Add a check to make it only run once. For the other 1,439 minutes of the day, it will just peg the CPU at 100% for no good reason.

Edited 2007-04-17 21:46

Reply Score: 5