NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
jonnymorris98
Dec 17, 2020Tutor
Can I restore only good files from backup USB disk to overwrite zero byte files?
Just checking through my C volume I noticed some folders contain zero byte files, the time stamp is 2018 (all files in a folder have the exact same time and date) so I don't think this has anything to do with a disk upgrade I just performed, it's more likely to be a bad copy operation from 2018, I seem to recall I was having permission problems some time ago which are (fingers crossed) all sorted now.
Luckily I do have a USB drive backup, but to save me from manually checking every folder is there any 'Backup Restore' facility that will overwrite only zero byte files with good files from my USB drive? The last thing I want to do is overwrite good files on the main disks with zero byte files that might be on the USB drive, or backup the zero byte files from the main disks to the USB drive.
If I have to go through each folder manually then I will, just thought I'd ask if there's a better way.
Also is there a way of finding all folders / files of zero bytes?
2 Replies
Replies have been turned off for this discussion
- StephenBGuru - Experienced User
jonnymorris98 wrote:
Also is there a way of finding all folders / files of zero bytes?
You can do this on a windows PC that has access to the shares using powershell. This command will do it:
gci -rec -force -path \\nasname\sharename | foreach-object { if($_.length -eq 0) { write-host ("{0}" -f $_.FullName) } }Use the real nas name (or IP address) and share name of course. If the USB disk is connected to the PC, you can use the Windows path to the USB folder instead of \\nasname\sharename
You can write this to a file (for example output.txt) by adding
*> .\output.txt
to the end of the command.
I'm not sure if this will report zero-byte folders or not (I don't have any easy way to test that).
StephenB wrote:
jonnymorris98 wrote:Also is there a way of finding all folders / files of zero bytes?
You can do this on a windows PC that has access to the shares using powershell. This command will do it:
gci -rec -force -path \\nasname\sharename | foreach-object { if($_.length -eq 0) { write-host ("{0}" -f $_.FullName) } }This is proving to be very useful and time-saving, thank you very much!
It's odd the way only a few folders have zero byte files in them, and when they are affected it's not always all files, it might be all of them or it might be from part way down the list (sorted by name).
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!