PASE - how to delete files from folder older than X days

By kimot, 19 January, 2023

If you want to delete all files given type (*pdf) older than 10 days from specific folder you can use this command directly from IBM i command line. 

/QOpenSys/pkgs/bin/find - is used because IBM i find command doesn't allow -delete option.

QSH CMD('/QOpenSys/pkgs/bin/find /directory_where_files_are/ -mtime +10 -type f -name ''*.pdf'' -delete')