Skips (does not select) the specified number of items. (Get-Content $sourceFile | Select-Object -Skip $tFLC) | Add-Content $targetFile You can go to the overviews of the copies in other clients, the. $sourceFile = "\\sserver\sshare\sfolder\xyz.txt" The system displays a list of all client copies in which the logon client was the target client. PowerShell $targetFile = "\\tserver\tshare\tfolder\CopyLog.txt" The PowerShell example below uses get-content piped over to select-object using the -skip parameter with the number value based on the copy log current line count,then it pipes that over to add-content to append the new log file data as preferred. Append what's there after that line to the target log file. Get the line count value from your target log and then use that number when you read from the source log to skip that number of lines when it reads it. The target log file has the latest detail in it copied from the source log. I have read that a RSync server would be helpful here, but the communication must cross multiple corporate firewalls blocking everything except smb file share, and the device that generates the logs should not be modified, so I do not think that is an option. Is there a clever combination of robocopy, xcopy, or other windows commands to accomplish this? Robocopy can resume partial downloads, but I could not get it to work in this case. The pc running the copy task can access both the source file share as well as the target file share, but both shares are in different networks, and this pc is the only bridge between them. The source files, and the target folder are only available via SMB file share, no other communication channel between the two systems is allowed. It is not required to compare the beginning of the source and target files. (And if parts of the log files somehow were modified after writing, the entire log would be untrustworthy and useless anyway). I can trust the programs that generate the logs to only ever append to the end of the file. Since the network is rather slow and congested, I do not want to transfer the whole files each time, but only the new lines, that were added after the previous copy. The files are available via SMB network share. I have a couple of log-files, growing one line at a time, as log files do.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |