Community Discussions and Support
Accidentally Deleted a Folder

[quote user="bfluet"]
I modified the script ... but it ends up leaving the archive attribute set to off for all .pmm files.  I don't see this as a problem but welcome feedback or any other suggestions for a workaround.
[/quote]

Actually this would be a problem for me, I use the archive bit in incremental backups.
One solution is to store and reapply the the "lack of archive bit" state.

::BEGIN
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
ECHO.> empty.tmp
FOR %%I IN (*.PMM) DO (
>>report.txt ECHO.%%~nI.PMM and %%~nI.PMI are the pair
>>report.txt ECHO.of files for the Pegasus Mail Folder named:
ATTRIB %%I | FINDSTR /B "A" >nul || (ATTRIB +A %%I & SET ABIT=0)
FC %%I empty.tmp /A /LB1 | FINDSTR /B /V "Comparing Resync *****" >>report.txt
IF [!ABIT!] == [0] ATTRIB -A %%I && SET ABIT=
)
DEL empty.tmp
START "" NOTEPAD report.txt
ENDLOCAL
::END

<P>[quote user="bfluet"] I modified the script ... but it ends up leaving the archive attribute set to off for all .pmm files.  I don't see this as a problem but welcome feedback or any other suggestions for a workaround. [/quote]</P> <P>Actually this would be a problem for me, I use the archive bit in incremental backups. One solution is to store and reapply the the "lack of archive bit" state.</P> <P>::BEGIN @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION ECHO.> empty.tmp FOR %%I IN (*.PMM) DO ( >>report.txt ECHO.%%~nI.PMM and %%~nI.PMI are the pair >>report.txt ECHO.of files for the Pegasus Mail Folder named: ATTRIB %%I | FINDSTR /B "A" >nul || (ATTRIB +A %%I & SET ABIT=0) FC %%I empty.tmp /A /LB1 | FINDSTR /B /V "Comparing Resync *****" >>report.txt IF [!ABIT!] == [0] ATTRIB -A %%I && SET ABIT= ) DEL empty.tmp START "" NOTEPAD report.txt ENDLOCAL ::END </P>

My mailbox is set to retain messages in the New Mail folder until I delete or move them. Typically, I make a new folder about once a year, then move all the messages into it from the New Mail folder. These "archive" folders are typically named "05_31_08", "08_20_11," etc., indicating the ending date of mail in that folder.

I accidentally deleted one of the archive folders yesterday. My Pmail\Mail folder was backed up a few months ago, so the folder that's now missing is present there. However, New Mail messages in the backup are not up to date, so I can't simply copy and paste the entire PMAIL\Mail folder to restore it.

Is there any way to identify the missing folder in the backup, in order to copy and paste only that folder? The folders all have unique names, so I can't tell one from the other. 

Thanks!

<P>My mailbox is set to retain messages in the New Mail folder until I delete or move them. Typically, I make a new folder about once a year, then move all the messages into it from the New Mail folder. These "archive" folders are typically named "05_31_08", "08_20_11," etc., indicating the ending date of mail in that folder.</P> <P>I accidentally deleted one of the archive folders yesterday. My Pmail\Mail folder was backed up a few months ago, so the folder that's now missing is present there. However, New Mail messages in the backup are not up to date, so I can't simply copy and paste the entire PMAIL\Mail folder to restore it.</P> <P>Is there any way to identify the missing folder in the backup, in order to copy and paste only that folder? The folders all have unique names, so I can't tell one from the other. </P> <P>Thanks!</P>

OK, let me followup with another question. Let's say I copy all the .CNM files to a temporary directory (I assume these are New Mail files). Then, I overwrite the entire "Mail" directory from the backup copy that I made a few months ago. Next, I paste the .CNM files back into the "Mail" directory from the temporary directory. Will this work?

EDIT: I just realized I would also need to save and restore the current version of the COPYSELF folder and "Recent search results" in order to do this. I don't care about search results, but the COPYSELF folder is important. Anyone have a solution?

 

<P>OK, let me followup with another question. Let's say I copy all the .CNM files to a temporary directory (I assume these are New Mail files). Then, I overwrite the entire "Mail" directory from the backup copy that I made a few months ago. Next, I paste the .CNM files back into the "Mail" directory from the temporary directory. Will this work?</P> <P>EDIT: I just realized I would also need to save and restore the current version of the COPYSELF folder and "Recent search results" in order to do this. I don't care about search results, but the COPYSELF folder is important. Anyone have a solution?</P> <P mce_keep="true"> </P>

[quote user="Jack_L"]
Is there any way to identify the missing folder in the backup, in order to copy and paste only that folder? The folders all have unique names, so I can't tell one from the other. 
[/quote]

 You can run a batch script like below in the backup directory containing the .PMI and .PMM file pairs.

::BEGIN
@ECHO OFF
ECHO.> empty.tmp
FOR %%I IN (*.PMM) DO (
>>report.txt ECHO.%%~nI.PMM and %%~nI.PMI are the pair
>>report.txt ECHO.of files for the Pegasus Mail Folder named:
FC %%I empty.tmp /A /LB1 | FINDSTR /B /V "Comparing Resync *****" >>report.txt
)
DEL empty.tmp
START "" NOTEPAD report.txt
::END

 

<P>[quote user="Jack_L"] Is there any way to identify the missing folder in the backup, in order to copy and paste only that folder? The folders all have unique names, so I can't tell one from the other.  [/quote]</P> <P> You can run a batch script like below in the backup directory containing the .PMI and .PMM file pairs.</P> <P>::BEGIN @ECHO OFF ECHO.> empty.tmp FOR %%I IN (*.PMM) DO ( >>report.txt ECHO.%%~nI.PMM and %%~nI.PMI are the pair >>report.txt ECHO.of files for the Pegasus Mail Folder named: FC %%I empty.tmp /A /LB1 | FINDSTR /B /V "Comparing Resync *****" >>report.txt ) DEL empty.tmp START "" NOTEPAD report.txt ::END</P> <P mce_keep="true"> </P>

Thanks for this script.  I have added it to my toolbox.

One point worth noting.  The FC command seems particular to file attributes.  In my tests, .pmm files that did not have any file attributes set were reported by the FC command as "no such file or directory".   I modified the script as below but it ends up leaving the archive attribute set to off for all .pmm files.  I don't see this as a problem but welcome feedback or any other suggestions for a workaround.

::BEGIN
@ECHO OFF
ECHO.> empty.tmp
FOR %%I IN (*.PMM) DO (
>>report.txt ECHO.%%~nI.PMM and %%~nI.PMI are the pair
>>report.txt ECHO.of files for the Pegasus Mail Folder named:
attrib +a %%I
FC %%I empty.tmp /A /LB1 | FINDSTR /B /V "Comparing Resync *****" >>report.txt
attrib -a %%I
)
DEL empty.tmp
START "" NOTEPAD report.txt
::END

 

<p>Thanks for this script.  I have added it to my toolbox.</p><p>One point worth noting.  The FC command seems particular to file attributes.  In my tests, .pmm files that did not have any file attributes set were reported by the FC command as "no such file or directory".   I modified the script as below but it ends up leaving the archive attribute set to off for all .pmm files.  I don't see this as a problem but welcome feedback or any other suggestions for a workaround. </p><p>::BEGIN @ECHO OFF ECHO.> empty.tmp FOR %%I IN (*.PMM) DO ( >>report.txt ECHO.%%~nI.PMM and %%~nI.PMI are the pair >>report.txt ECHO.of files for the Pegasus Mail Folder named: attrib +a %%I FC %%I empty.tmp /A /LB1 | FINDSTR /B /V "Comparing Resync *****" >>report.txt attrib -a %%I ) DEL empty.tmp START "" NOTEPAD report.txt ::END</p><p> </p>
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft