1

Topic: HOTFIX 0.5.1: incorrect crontab job

Hi all, when I run

find /var/virusmails -ctime +30

lot of mails (*.gz) where found. When I run   

find /var/virusmails -ctime +30 | xargs rm -rf {}

manually (shell - Debian Lenny), it deletes the hole virusmail directory.
Is there a different by running a cron job or shell command or is there an ending shlash missung (.../virusmails/ ...)?



HOTFIX: incorrect crontab job

#---- Run below command in terminal ----
# sudo crontab -e -u amavis
1   5   *   *   *   find /var/virusmails -ctime +30 | xargs rm -rf {}

2

Re: HOTFIX 0.5.1: incorrect crontab job

Which linux distro do you use?

3

Re: HOTFIX 0.5.1: incorrect crontab job

ZhangHuangbin wrote:

Which linux distro do you use?

Debian Lenny
Thx

4

Re: HOTFIX 0.5.1: incorrect crontab job

It works for me here:

amavis@demo:~$ ls -dl /var/virusmails/
drwxr-xr-x 2 amavis amavis 4096 2010-01-04 21:07 /var/virusmails/

amavis@demo:~$  find /var/virusmails -ctime +30 | xargs rm -rf {}

amavis@demo:~$ ls -dl /var/virusmails/
drwxr-xr-x 2 amavis amavis 4096 2010-01-04 21:07 /var/virusmails/

Run as root:

root@demo:~# ls -dl /var/virusmails/
drwxr-xr-x 2 amavis amavis 4096 2010-01-04 21:07 /var/virusmails/

root@demo:~# find /var/virusmails -ctime +30 | xargs rm -rf {}

root@demo:~# ls -dl /var/virusmails/
drwxr-xr-x 2 amavis amavis 4096 2010-01-04 21:07 /var/virusmails/