Home Forums OS X Server and Client Discussion Questions and Answers No sucess trying to run cron script to archive my PIX logs

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #364433
    Bonthron
    Participant

    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?

    #364439
    Bonthron
    Participant

    [QUOTE BY= MacTroll] Your script isn’t executable.[/QUOTE]

    How can I make it executable? Or would that be something that’s way beyond the scope of my skills?

    #364448
    Bonthron
    Participant

    [QUOTE BY= MacTroll] chmod 755 <path to script>[/QUOTE]

    Thanks Joel.

    That was definitely within my skill set and it’s now working… and even better, I learned something. 😀

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Comments are closed