Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Delete all but the most recent backup file

by vinoth.ree (Parson)
on Jan 24, 2013 at 06:01 UTC ( #1015080=note: print w/ replies, xml ) Need Help??


in reply to Delete all but the most recent backup file

Any ideas on if a backup has not been created in past 24hrs that the most recent backup is kept and the rest are deleted?

So you need to check, whether the backup file created within the 24 hours first, if so, then delete all the backup files which are older than 24 hours

To find the files created withing 24 hours try this,

if (1 > -M $filename) { # Your code goes here }

If any files found then do your normal delete (deletes backups that are older than 24 hours) or skip the deletion part.


Comment on Re: Delete all but the most recent backup file
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015080]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2014-10-31 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (225 votes), past polls