Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'XJanitor.pl intelligently runs required maintenance tasks' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
XJanitor.pl intelligently runs required maintenance tasks
Authored by: r0adrage on Mar 20, '03 02:20:01PM

Just wanted to point out that checking it once daily, as rob suggested in his note, probably would not work. The "daily" events are already set up to check once per day, but if the computer is off it doesn't get run. The point of this type of software is to check often, in order to insure that at least one of the checks will happen when the computer is on.

I would agree that checking every 15 minutes is excessive, but only checking once a day would only marginally increase the chances of the events being run.

A better solution would be to activate XJanitor on a "wake up" event (via AppleScript, perhaps?). So when you wake your computer from sleep, one of the things it does is to check the periodic events and run them if needed. That would alleviate the need to constantly poll, and you would only spend those cycles on the check when the computer isn't doing anyhing yet.



[ Reply to This | # ]
XJanitor.pl intelligently runs required maintenance tasks
Authored by: luhmann on Mar 20, '03 03:34:34PM

I have Xjanitor set to check at 15 minutes after the hour - this is once an hour. It doesn't take up any resources at all when it checks. It simply checks the modification dates of the logs for the periodic scripts. If they haven't been run in the appropriate time frame then it runs them. Even if your computer is asleep a lot, the chances are that at least once a day it is on at 15 minutes after the hour. It seems like a reasonable solution to me. Apple, on the other hand, has it set to run at a specified time in the middle of the night when your laptop is probably off or asleep.



[ Reply to This | # ]
XJanitor.pl intelligently runs required maintenance tasks
Authored by: luhmann on Mar 20, '03 03:36:35PM

Addendum: I personally would rather not have a surge of activity on my comptuer when it wakes from sleep or turns on. Usually then is when I need to use it the most and I want it to be quick.



[ Reply to This | # ]
XJanitor.pl intelligently runs required maintenance tasks
Authored by: klktrk on Mar 20, '03 04:45:51PM
"A better solution would be to activate XJanitor on a "wake up" event (via AppleScript, perhaps?). So when you wake your computer from sleep, one of the things it does is to check the periodic events and run them if needed."

The problem is that the maintenance tasks need to be run as root. That's why the system cron should trigger them. To run them on wakeup or at another time triggered by the user would require authorizing the maintenance with an admin user password. That would quickly become annoying.



[ Reply to This | # ]
XJanitor.pl intelligently runs required maintenance tasks
Authored by: triplef on Mar 25, '03 02:37:55PM

A workaround for this problem would be a setuid'ed command line tool.



[ Reply to This | # ]
XJanitor.pl and Konfabulator
Authored by: skyhuv on Mar 20, '03 07:21:39PM

Konfabulator would be a perfect thing to initiate the XJanitor script...



[ Reply to This | # ]
Run XJanitor.pl 3 times per day...
Authored by: pmtav on Mar 28, '03 02:26:29PM
Rather than running the script hourly or daily, you can have the script run two or three times a day, as the script's author suggests on his page:

"For example, for some people it might be enough to just check three times a day, morning, afternoon, and evening, like this:
15 9,15,21 * * * root /Users/yourusername/Library/Scripts/Xjanitor.pl"

that would have the script run at 9:15 AM, 3:15 PM and 9:15 PM... that is adequate enought for me... without having it run each hour.

[ Reply to This | # ]