লগ রোবকপি কেবল ফলাফল Results


0

আমি একটি অপসারণযোগ্য এসএসডি-তে একটি ডিরেক্টরী মিরর ব্যাকআপ তৈরি করতে রবকোপি ব্যবহার করছি। অনুলিপি কার্যকর করে, তবে আমি স্ক্রিপ্টটি চালানোর সময় শুধুমাত্র ফলাফলের লগ রাখতে চাই । নীচের ফলাফল মত। আমি লগটি তৈরি করতে পারি তবে এতে সম্পূর্ণ স্ক্রিপ্টের ফলাফল "7000+" লাইন রয়েছে। আমি / টি এবং / এনডিএল সুইচগুলি ব্যবহার করার চেষ্টা করেছি, তবে তাদের কোনও দৃশ্যমান প্রভাব আছে বলে মনে হয় না।

এখানে চিত্র বর্ণনা লিখুন

#Script Mirrors the Network Directory for collected user manuals
#Logs Robocopy Results to a log file

$Time = Get-Date  #variable for the current date string
$Logfile = [string] 'c:\Script\BackupManuals.log'  #variable Log File Path - You need to create the .txt file first

Add-Type -AssemblyName PresentationFramework #Loads the framework for the message box if needed


ROBOCOPY "\\server-fs-03\Groups\Automation\Support\Master Product Manuals" "V:\Master Product Manuals" /MIR /COPY:DATSO  /log+:"c:\Script\BackupManuals.log" /tee /ndl
#$Robo_results = $Robo_test -match '^(?= *?\b(Total|Dirs|Files)\b)((?!    Files).)*$'


Write-Output "$Time $robo_results"  #Command Line output for Powershell Visual display - optional
#pause #for testing to visually see output

উত্তর:


0

আপনি / এনএফএল স্যুইচটিও ব্যবহার করতে চাইবেন।

/nfl Specifies that file names are not to be logged. 

পারফেক্ট, আমি জানতাম যে এখানে কিছু সাধারণ ছিল যা আমি মিস করছি!
— 21
আমাদের সাইট ব্যবহার করে, আপনি স্বীকার করেছেন যে আপনি আমাদের কুকি নীতি এবং গোপনীয়তা নীতিটি পড়েছেন এবং বুঝতে পেরেছেন ।
Licensed under cc by-sa 3.0 with attribution required.