qball2k5
asked on
Removing files older then 7 days from a network drive
Hey Experts!
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.
Example script would be very helpful.
P.S. I'm kinda new to Linux
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.
Example script would be very helpful.
P.S. I'm kinda new to Linux
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also You can modify the exec part by: -exec rm -f \{\} \;
ASKER
Thanks again!