Link to home
Start Free TrialLog in
Avatar of msidnam
msidnamFlag for United States of America

asked on

Bash script for ubuntu to remove files older than 30 days

I'm not a programmer but one of our dept's has an SFTP server that they would like files older than 30 days to be deleted. The folders are in /home/clientname

Can anyone point me in the direction of a script that could cycle through the /home folder and certain sub directories for files older than 30 days and delete them? I could put the script in a cron job so it could run daily, weekly or monthly.

We are using ubuntu 64bit server version 10.10

thank you.
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of msidnam

ASKER

Excellent thank you. I will try tomorrow morning when i get in the office. I will report results.
Avatar of msidnam

ASKER

This is great. thank you. I'm going to post something in exchange forum if you know power shell too :)