Delete / remove old / order files in linux automatically

Code:
find /tmp/test -ctime +60 -delete

The above command  will delete any files created over 60 days ago in the /tmp/test  folder (and all subfolders).

You can add this to a cron job and it will be automatic daily, weekly, monthly

Advertisements

One thought on “Delete / remove old / order files in linux automatically

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s