Removing files older then 7 days from a network drive
I have a backup script that puts a zipped tar file onto a network drive. The file name has the date of the backup...it's done daily. My question is I need to write a script to run once a week to remove the backups that are more then 7 days old....Right now...I do it manually....which is dumb.
I have the drive mounted..and the file are backed up to unique folder (e.g. the username). I want to write a script that parses the filename and then determines if the file needs to be removed or not.