I’m a newbie to most of this and I’m learning as I go along – so any assistance would be greatly appreciated…
I’m running syslogd to capture the syslogs from my PIX firewall. I’m capturing the log just fine but I want to roll it and rename it to another directory on my drive but the cron job script I found on MacOSXhints.com < http://www.macosxhints.com/article.php?story=20031119120851749 > doesn’t seem to be working for me. This is the script:
******************************
#Script File to move the pix log
#First, moves the file and changes the name
#Then creates a new empty log
#Then restarts the syslogd daemon.
#Then changes the ownership and the group of the file
/bin/mv /var/log/pix.log /Users/admin/PIXlogs/`/bin/date +%m%d%y`.txt
/usr/bin/touch /var/log/pix.log
/usr/bin/killall -HUP syslogd
/usr/sbin/chown admin /Users/admin/PIXlogs/`/bin/date +%m%d%y`.txt
/usr/bin/chgrp admin /Users/admin/PIXlogs/`/bin/date +%m%d%y`.txt
******************************
I’m using CronniX to set up the crontab to run this script as the system (root) user but nothing seems to happen. If I run each line from the script in a shell and precede each line with sudo it works properly.
I’ve saved the script as a regular txt file to: /Library/Scripts/cronscripts/PIXlogscript
I’ve created the schedule in CronniX as the System (root) user and added the script to the Command area at the bottom of the CronniX Schedule Edit window.
Why can’t I get cron to run this script?
Comments are closed