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

A cron job to kick off LiveUpdate UNIX
So I decided I would share. :) This is the cron job I use to keep OS X machines up to date with LiveUpdate and Norton AntiVirus 9.0.1. It's a fairly simple script. I put this in /sw/etc/cron.daily/ because I use anacron that I installed with Fink. If you don't want Fink on your system then there is a system cron that is in /etc you can use, but it requires that the machine must be on when the cron job should run. This condition was not acceptable to me. Read on to see the script...

The first line of the script is like any other shell script: #!/bin/sh to tell it to run it with that shell. Hope you all like. Make sure you catch the line breaks below. If you have troubles just post here. Be sure to change the two instances of yourdomain.com to your company's domain / server or just use symantec, and change the Service Desk phone number from 222 222-2222 to your own.

#!/bin/sh

################
#
# Joshies Nav Updater
# 2004020601
#
################

# echo "Testing age of liveupdt.log file..."
# next TWO lines should be one line; remove the line break
count=`find "/Library/Application Support/Norton Solutions Support/LiveUpdate/" 
  -name liveupdt.log -a -mtime -7 -print | wc -l` > /dev/null
if [ $count -eq 1 ]
then
  # echo "The file is under 30 days... ending check..."
  exit 0
#else
  # echo "The file is not so new. Moving on..."
fi

# echo "Testing for connection..."
while true ; do
(
  dig liveupdate.yourdomain.com IN A &
  DIG_PID=$!
  { sleep 2 ; kill $DIG_PID ; } &
  wait $DIG_PID
  ) 2>/dev/null | grep -q '^[^;]*yourdomain.com' && break
done

# echo "Connection found..."
if [ -f "/Applications/Norton Solutions/LiveUpdate.app/Contents/MacOS/Liveupdate" ]
then
  # next TWO lines should be one; remove the line break
  "/Applications/Norton Solutions/LiveUpdate.app/Contents/MacOS/LiveUpdate" 
     -liveupdateautoquit YES -update LUal
else
  # next FOUR lines should be one; remove the line breaks
  osascript -e 'tell app "Finder" to activate' -e 'tell app "Finder" to 
    display dialog "ALERT: Please contact the Service Desk at (222) 222-2222. 
    Your AntiVirus software needs repair. LiveUpdate could not be found in the
    expected location."'
fi
exit 0
[robg adds: I haven't tested this one...]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,184 views]  

A cron job to kick off LiveUpdate | 2 comments | Create New Account
Click here to return to the 'A cron job to kick off LiveUpdate' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A cron job to kick off LiveUpdate
Authored by: LeeH on Feb 23, '04 12:55:58PM

I think this can also be accomplished via the Scheduler included in Systemworks. You can set it up to do an update daily, weekly, or monthly at a specified time.



[ Reply to This | # ]
A cron job to kick off LiveUpdate
Authored by: jlevitsk on Mar 03, '04 09:06:59PM

However the scheduler does per user crontabs which does not work well in a corp environment. Also the scheduler does not check for network connectivity so it will kick off LiveUpdate even if you have no internet connection. With my cron job it will run every 7 days even if a user is not logged on.



[ Reply to This | # ]