Today I was asked to come up with a script that could do the following:
- check three directories on the D:\ for files older than 30 days
- If there are files on there older than 30 days then move them to E:\ using the exact directory structure (this is to backup old log files to retain disc space)
- We need to have a log running which would record the date, time, log name and then if the move files fails to raise an event in the event viewer or send an email to notify of error.
Now I know I will get treated like a noob, I have created some scripts to get this working by doing each step first and then trying to add them together, this always seems to fail.