On Tue, 26 Nov 2002, Jeremy Schwartz wrote:

=>I am trying to rotate my Apache logs using Cron and the following shell
=>script:
=>
=># /bin/sh
=>
=>mv /var/log/httpd/access_log /users/admin/logs/
=>apachectl restart
=>
=>This script is set to 755 and is being executed by the root crontab. The
=>first line is executing correctly, the log file is moving out of
=>/var/log/httpd/ to /users/admin/logs/ but apache is not restarting.
=>
=>This may seem OT for this list, but I figure if someone can either shed some
=>light on this or provide me a Perl example I'd be right on topic.
=>
Jeremy,

At quick glance, I'd say qualify all commands, ie. use a fully qualified
path for all the commands in your script:

mv /var/log/httpd/access_log /users/admin/logs/ -- /bin/mv or /usr/bin/mv
apachectl restart -- <path_to_apache>/bin/apachectl restart

Also, the script is running so this doesn't seem to be a problem, however
you may run into problems later with the 'space' in the first line, so:

# /bin/sh -- should really look like #!/bin/sh


Hope this helps--

                                - Dwalu
..peace
--
I am an important person in this world -
Now is the most important time in my life -
My mistakes are my best teachers -
So I will be fearless.
                                - Student Creed

Reply via email to