G
George Lewycky
My problem is trying to delete all files older than 60 days in the
directory /MLIM_data/archive/cmp through a Perl script.
At the UNIX command prompt, the following command works. It lists all
files older than 60 days and deletes them as well : find
/MLIM_data/archive/cmp -mtime +60 -exec rm -r {} \;
However, I need to use this command thru a Perl script and none of the
following combinations work.
# `find /MLIM_data/archive/cmp -mtime +60 -exec rm -r {} \;`;
# find /MLIM_data/archive/cmp -mtime +60 -exec rm -r {} \;
# `find /MLIM_data/archive/cmp -mtime +60`
# `find /MLIM_data/archive/cmp -mtime +60`;
# system("find /MLIM_data/archive/cmp -mtime +60 -exec
rm -r {} \;");
The only thing that does work from within a Perl script is a listing of
all the files older than 60 days :
system("find /MLIM_data/archive/cmp -mtime +60");
How can I delete all files older than 60 days in the directory
/MLIM_data/archive/cmp through my Perl script?
Thanks
George Lewycky
directory /MLIM_data/archive/cmp through a Perl script.
At the UNIX command prompt, the following command works. It lists all
files older than 60 days and deletes them as well : find
/MLIM_data/archive/cmp -mtime +60 -exec rm -r {} \;
However, I need to use this command thru a Perl script and none of the
following combinations work.
# `find /MLIM_data/archive/cmp -mtime +60 -exec rm -r {} \;`;
# find /MLIM_data/archive/cmp -mtime +60 -exec rm -r {} \;
# `find /MLIM_data/archive/cmp -mtime +60`
# `find /MLIM_data/archive/cmp -mtime +60`;
# system("find /MLIM_data/archive/cmp -mtime +60 -exec
rm -r {} \;");
The only thing that does work from within a Perl script is a listing of
all the files older than 60 days :
system("find /MLIM_data/archive/cmp -mtime +60");
How can I delete all files older than 60 days in the directory
/MLIM_data/archive/cmp through my Perl script?
Thanks
George Lewycky