0

I have a file in cron.daily:

root@nagios.example.com:/# cat /etc/cron.daily/nagios-logs
/usr/bin/nice -n 19 /bin/gzip --fast /var/log/nagios3/archives/*
root@nagios.example.com:/# ls -l /etc/cron.daily/nagios-logs
-rwxr-xr-x 1 root root 65 Apr 15 17:51 /etc/cron.daily/nagios-logs
root@nagios.example.com:/#

but it's not doing anything. Any ideas why?

Poma
  • 1,299
  • 6
  • 24
  • 35

1 Answers1

3

Your file /etc/cron.daily/nagios-logs is neither a program nor an executable script. You can make it a shell script by adding #!/bin/sh to the beginning of the file

#!/bin/sh
/usr/bin/nice -n 19 /bin/gzip --fast /var/log/nagios3/archives/*

The shell script also needs to be executable

root@nagios.example.com:/# chmod 755 /etc/cron.daily/nagios-logs

but I see from the output of your ls -l command that your file already has the correct file permissions

Erik Sjölund
  • 2,115
  • 5
  • 22
  • 27