Re: File delete script not working



mydejamail@xxxxxxxxxxx wrote:
I having a problem applying this script, it just doesn't seem to work.

The purpose is to delete all files over 30 days old. The directories
are 1,2,3,4,5.

Can anyone who knows about find and xargs please help.
It does not from the command line or a cron job.


cd /var/www/html/zm/events
find 1 -type f -mtime +30 | xargs rm -f
find 2 -type f -mtime +30 | xargs rm -f
find 3 -type f -mtime +30 | xargs rm -f
find 4 -type f -mtime +30 | xargs rm -f
find 5 -type f -mtime +30 | xargs rm -f

Why not:

find [12345] -type f -mtime +30 -exec rm -f {} \;
.



Relevant Pages

  • Re: File delete script not working
    ... The purpose is to delete all files over 30 days old. ... Can anyone who knows about find and xargs please help. ... It does not from the command line or a cron job. ... special characters in the names. ...
    (comp.os.linux.misc)
  • Re: File delete script not working
    ... The purpose is to delete all files over 30 days old. ... Can anyone who knows about find and xargs please help. ... It does not from the command line or a cron job. ...
    (comp.os.linux.misc)
  • [RFC: 2.6 patch] remove the broken SCSI_ACORNSCSI_3 driver
    ... * Abandoned using the Select and Transfer command since there were ... Once debugged, remove the #undef, otherwise to debug, ... -unsigned int dmac_address ... * Purpose: differentiate between commands that have a DATA IN phase ...
    (Linux-Kernel)
  • Re: Command line to remove duplicate files?
    ... Ohmster wrote: ... what xargs does? ... So what xargs does is pretty much pass on large numbers to the command ... Put "messageforohmster" in message body ...
    (alt.os.linux)
  • Re: some basic command line stuff
    ... The xargs program reads input in order to build up a command to ... which the shell will split on. ... ++ echo 19/P6211874.JPG ...
    (comp.unix.programmer)