ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Dumb question but maybe somebody knows how. Probably a form of Sync.

<< < (3/5) > >>

questorfla:
Tomos.  I guess it is too small to even call a script .  More like a complicated command line but it still did the job and surprised the heck out of me when it ran :)
I also just figured out WHY all the problems on these backups.  Some nit-wit has been putting each sequential run inside the folder of the previous run instead of Overwriting the older files, it made whole new copies of them in another sub folder.
I also know who it was  :)  but that is another story.  They will find ourt soon enough.
This is why things were getting exponentially out of hand.  If I had not found this I wonder how deep they could have gone before something crashed?  Or maybe windows would just error out on too deep to copy?  All these drives are full of multiple duplicates :( . well sort of dupliates.  ONE of them wil be the newest of every file and it should be in be deepest sub-folder.
Maybe i will just leave them,  Extra backups.

Shades:
Do not consider a file that is stored in 2 different locations on the same hard disk as 'backed up'. That attitude will bite you at your most inconvenient moment(s).

Different disk - mweh
Different computer - getting there
Different house/company - better
Different country - even better
Different continent - great
Different planet - awesome!

questorfla:
Sorry Tomos:  Thought i had put it with this question.  It has been a LOOONG week.  I had put it on another thread.
But repeated here just in case.  I gwet so much help from everyone maybe this is will be of some use to some other poor sucker like me who hired on to work with (FOR!!) a bunch of techno-nit-wits.
Still barely qualifies as script but darn sure does the job for FINDing them.  Getting Rid of them .. well I had issues there as it finds and stores complete paths including spaces in the file path.  When I tried other variations using the same logic to DELETE them i can see what why it stopped by looking at what it found.  a whole list of name as this:
      "C:\etc\etc\and you see\spaces in the way\zerolengthfile.txt."  And many more like it. 
(probably due to the same nit who multileveled her backups)  I got a lot of invalid path etc.  Once i found them and had the list of where they were most were in the same places anyway. 
Not too hard to remove but.. if this could have done the delete too...
i could have created a list of the filenames that were getting deleted AND delete them in one swoop.  Then add in 4WD's cipher and...all the Old encrypts would be gone as well
:(  As long as i don't end up wiping out the entire windows folder i should be OK :(  Maybe?


--- Code: Text ---@echo off   for /r %%F in (*) do if %%~zF==0 echo “%%F” >> zerobytefiles.txt
ps:  change the double % to single % if running from prompt.   Also the >> I am chicken and run from batch.
So I have some small chance of stopping if major bad things happen.

Shades:
@echo off
echo @ECHO OFF>> zerobytefilesremover.bat
for /r %%F in (*) do if %%~zF==0 echo DEL /F /Q “%%F”>> zerobytefilesremover.bat

This creates a batch file that should delete all the 0-byte files when executed.

4wd:
Then add in 4WD's cipher and...all the Old encrypts would be gone as well
:(  As long as i don't end up wiping out the entire windows folder i should be OK :(  Maybe?-questorfla (May 29, 2015, 11:27 PM)
--- End quote ---

Use PowerShell:

--- Code: PowerShell ---get-childitem r:\ -Recurse -Force -ErrorAction SilentlyContinue | Where-Object {$_.Attributes -ge "Encrypted"} | Remove-Item -whatIf
Change the r:\ to whatever path you require that isn't the Windows drive.

The -whatIf parameter on the end tells you what will happen if the command was to execute (Remove-Item) but it doesn't actually execute it.

Remove the -whatIf if you're happy about what will happen.

Sample output:

--- Code: Text ---PS C:\> get-childitem r:\ -Recurse -Force -ErrorAction SilentlyContinue | Where-Object {$_.Attributes -ge "Encrypted"} | Remove-Item -whatIf ConfirmThe item at Microsoft.PowerShell.Core\FileSystem::R:\test\encrypt has children and the Recurse parameter was notspecified. If you continue, all children will be removed with the item. Are you sure you want to continue?[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): AWhat if: Performing the operation "Remove Directory" on target "R:\test\encrypt".What if: Performing the operation "Remove File" on target "R:\test\encrypt\20150505-121915.gpx".PS C:\>

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version