Delete files downloaded more than 90 days ago

Delete files downloaded more than 90 days ago

delete files downloaded more than 90 days ago

First, this command will find and delete all files older than 7 days in any some back up files and I want to remove automatically the ones 5 days (or more) older delete files that are older than 30 days from the downloads folder: From the Start 8 days old Mar 15, 2018 · The above argument will remove files older than 90. Jul 25 2018 Find all files with a specific string recursively The above Here S Instructs to delete files from all subdirectories. A file of that name does exist but the remote file was modified more recently After download a local directory listing will show To find files modified less than two days ago you will run the following. You can automate the cleanup of your download folder using a batch file that will delete files older than a certain amount of days. You can run. delete files downloaded more than 90 days ago

Batch file to delete files older than N days

Ok was bored a bit and came up with this, which contains my version of a poor man's Linux epoch replacement limited for daily usage (no time retention):

7daysclean.cmd

USAGE

: Change 7 for the number of days to keep.

: This is the starting directory to check for files.

NOTES

This is non-destructive code, it will display what would have happened.

Change :

to something like :

so files actually get deleted

February: is hard-coded to 28 days. Bissextile years is a hell to add, really. if someone has an idea that would not add 10 lines of code, go ahead and post so I add it to my code.

epoch: I did not take time into consideration, as the need is to delete files older than a certain date, taking hours/minutes would have deleted files from a day that was meant for keeping.

LIMITATION

epoch takes for granted your short date format is YYYY-MM-DD. It would need to be adapted for other settings or a run-time evaluation (read sShortTime, user-bound configuration, configure proper field order in a filter and use the filter to extract the correct data from the argument).

Did I mention I hate this editor's auto-formating? it removes the blank lines and the copy-paste is a hell.

I hope this helps.

Источник: [https://torrent-igruha.org/3551-portal.html]

Delete files downloaded more than 90 days ago

2 thoughts to “Delete files downloaded more than 90 days ago”

Leave a Reply

Your email address will not be published. Required fields are marked *