Why clog command line in shell script does not run by crontab
-
my shell script file's contains
clog -i -s 2097120 /var/log/system.log
clog -i -s 2097120 /var/log/filter.log
clog -i -s 512144 /var/log/dhcpd.log
clog -i -s 512144 /var/log/vpn.log
clog -i -s 512144 /var/log/openvpn.log
clog -i -s 512144 /var/log/portalauth.log
clog -i -s 512144 /var/log/ipsec.log
clog -i -s 512144 /var/log/slbd.log
clog -i -s 512144 /var/log/lighttpd.log
clog -i -s 512144 /var/log/ntpd.log
it's work properly when run shell script by command line,but not work when run by crontab -
You need the full path to clog in a script. It inherits the path from your shell, but that is not present when running from cron and such.
Use /usr/sbin/clog to start each line.
Why are you clearing the logs from cron, anyhow?
They are circular logs, they will never grow in size or fill up any more space than they do when created.
-
Thank you :)
I must backup every log files every days.
I don't want to let it truncate log file before backup.