PDA

View Full Version : auto delete files older then x days in APG



slavicp
2012-04-27, 04:05 AM
Hello,
Does anybody know how to make that files older then x days to be deleted from a folder in APG?
thanks,
BR,
slavicp

kaizzer545
2012-04-27, 04:59 AM
Mostly it will depedn wich folder i.e. logs not longer than 100Mb.. CDR's no longer than 5 days please be more specific.. AXE system is big please ...

slavicp
2012-04-27, 05:52 PM
The problem that is not related to AXE system... the task is that a folder for example from ftpvol is used for storing some files (the folder is used only for storage for 7 days) recieved from other server...
I know that is stupid request from the people who decided such kind of solution to use...
And they ask that these files that are older then 7 days to be deleted automatic... from that folder...
I know that a solution could be using "FORFILES" command (that is default available in windows server) and make a .bat file with the following comand:
For example:
forfiles /P c:\DBbackup\CT\LogShipping\ /S /M *.* /D -1 /C "cmd /c del @path"
That simple command deletes (cmd /c del @path) all files (*.*) from a path (c:\DBbackup\CT\LogShipping\) that older than one day (/D -1)

But this script should be run once per N days... and the task scheduler in APG is not working... there is an error ... task schedulre couldn't run...
Thanks ahead,
BR,
slavicp

conall
2012-06-01, 04:42 PM
if the file in apg is exceed the limit,the system can auto overwrite the older file.if u want to save the older file,u can ftp the file to local.