Question: My webapp is hosted on a unix server using MySQL as database.

I wrote a Perl script to run backup of my database. The Perl script is inside the *cgi-bin* folde and it is working. I only need to set the cronjob and run the Perl script once a day.

The backups are stored in a folder named *db\_backups*,. However, I also want to add a command inside my Perl script to remove any files inside the folder *db\_backups* that are older than say 10 days ago.

I have searched high and low for unix commands and cannot find anything that matches what I needed.

Answer: 
On Unix you can't, because *the file's creation date is not stored in the filesystem*.

You may want to check out [stat](http://perldoc.perl.org/functions/stat.html), and [-M](http://perldoc.perl.org/functions/-X.html) (modification time)/[-C](http://perldoc.perl.org/functions/-X.html) (*inode change time*)/[-A](http://perldoc.perl.org/functions/-X.html) (access time) if you want a simple expression with relative timestamps (how long ago).
You should be able to do it without resorting to Unix commands. Loop through the files in your directory, use [`stat`](http://perldoc.perl.org/functions/stat.html) on each file to get its last modify time for a file, then use [`unlink`](http://perldoc.perl.org/functions/unlink.html) on the file to delete it if it's older than what you want.