Biterscript to delete all files > 14 days old
Closed
acidburn
-
May 26, 2010 at 01:55 PM
Richard.Williams Posts 25 Registration date Saturday November 7, 2009 Status Member Last seen July 18, 2012 - Aug 14, 2010 at 02:48 PM
Richard.Williams Posts 25 Registration date Saturday November 7, 2009 Status Member Last seen July 18, 2012 - Aug 14, 2010 at 02:48 PM
Related:
- Biterscript to delete all files > 14 days old
- Skype last seen days ago - Guide
- How to delete multiple files on mac - Guide
- Iphone 14 release date - Home - IOS
- How to delete whatsapp account without login - Guide
- Move files older than x days windows - Guide
1 response
Richard.Williams
Posts
25
Registration date
Saturday November 7, 2009
Status
Member
Last seen
July 18, 2012
14
Aug 14, 2010 at 02:48 PM
Aug 14, 2010 at 02:48 PM
Script is called as
n is number of days.
From the documentation for the function addtime(), (I am copying this section from the biterscripting website)
Leading characters may be dropped. Following examples illustrate.
"2" 2 seconds. (Please note that "2" is treated as 2 seconds, and NOT as 20 seconds.)
"321" 3 minutes, 21 seconds
"3000" 30 minutes
"30000000" 30 days
"0030000000" 30 days
"365000000" 365 days
So, the way the script is coded, it is deleting files older than 14 seconds, not 14 days. To make it 14 days, change the above condition to
The zeros are for hhMMss.
script "C:/Scripts/delete.txt" d("X:/mypath") n("14")
n is number of days.
($fctime < addtime(diff("-"+$n)))
From the documentation for the function addtime(), (I am copying this section from the biterscripting website)
Leading characters may be dropped. Following examples illustrate.
"2" 2 seconds. (Please note that "2" is treated as 2 seconds, and NOT as 20 seconds.)
"321" 3 minutes, 21 seconds
"3000" 30 minutes
"30000000" 30 days
"0030000000" 30 days
"365000000" 365 days
So, the way the script is coded, it is deleting files older than 14 seconds, not 14 days. To make it 14 days, change the above condition to
($fctime < addtime(diff("-"+$n+"000000")))
The zeros are for hhMMss.