Creating and deleting files automatically in shell scripts

I frigging love linux for this shit

appends the date to filename $date + (“%Y%m%d”)


tar -zcf documents.backup.$(date +”%Y%m%d”).gz Documents

locate files of five days and older find * -type f -mtime +5

So there i was creating files and then wondering about the bother in deleting them manually when i thought there must be some way and a bit of thinking meant no human interaction from me with a cron job.

You want to the aim the find at the right place with the delete syntax which i have omitted.

Only moan i now have to delete my calender reminder i set.

by golly but...

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

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

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.