Batch file with FORFILES is now operational at OBOA (.15 ip)


On 5-11-09 I implemented a new batch file that deletes files from the trashbox that are 10 days or older. See the code here:

=========================

rem Delete all files with BKF extension if they are more than 10 days old:
forfiles -pL:\trashbox\ServerBackup -s -m*.bkf -d-10 -c”CMD /c echo @FILE is more than 10 day old and will be deleted…”
forfiles -pL:\trashbox\ServerBackup -s -m*.bkf -d-10 -c”CMD /c del @FILE”

rem Delete all files with BJ3 extension if they are more than 10 days old:
forfiles -pL:\trashbox -s -m*.bj3 -d-10 -c”CMD /c echo @FILE is more than 10 day old and will be deleted…”
forfiles -pL:\trashbox -s -m*.bj3 -d-10 -c”CMD /c del @FILE”

=========================

The batch file runs every night on weekdays at 8:00 PM on x.x.200.15 server

 

NOTE the “-” before the parameter instead of the “/” This is the Windows 2000 forfiles.exe format because the server is a Windows 2000 server; If the server was a Windows 2003 server the command would have been:

forfiles /p L:\trashbox\ServerBackup /s /m *.bkf /d-10 /c"CMD /c
echo @FILE is more than 10 days old and will be deleted..."

forfiles /p L:\trashbox\ServerBackup /s /m*.bkf -d-10 /c"CMD /c del @FILE"

 

 

 

*** jp 5-11-09

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: