Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Need help with Powershell script

$
0
0

Hello Everybody, ive been searching arround for a script that will help me accomplish something on powershell, the closest ive found is found on this link http://social.technet.microsoft.com/Forums/scriptcenter/en-US/d8458aa8-3f65-4a54-869a-33525f72d12d/scriptbat-needed-to-zip-up-logfiles-and-delete-after-4-days?forum=ITCG

Im no good with script so its close but its not quite what I need...

I have several log files that are created daily in a folder route: C:\data\logs

what I need the script to do is to zip up all logs EXCEPT the last 2 day log files and save the zip file with the date name inside the C:\data\logs\zips folder

So just to be clear the script should do this:

1) zip all logs from C:\data\logs (EXCEPT last 2 days) and place the zip file in the C:\data\logs\zips directory.

2) once the zip is created it should delete the log files that it has already zipped (EXCEPT the last 2 days log files)

3) the zips folder must stay untouched of course.

I hace 7z installed on the computer

Any help with this ??

Thanks in advance!

Chris


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>